adding subviews without zooming to TTPhotoview of TTPhotoViewController

Skip to first unread message


Mar 28, 2012, 3:22:46 AM3/28/12
to Three20
Looking at other samples & suggestions I have subclass TTPhotoview.

I would like to display additional labels or details regarding current
photo. I want to place those details in left or top corner.

I am able to place and display UILabel in SubView and display it,
however when user double tap to zoom the image, those label zooms &
moves along with that. I want those details to still display but
remain in same position after zooming as well.

Below is ShowCaption method of TTPhotoView - (void)showCaption:
(NSString*)caption {

UILabel* sampletext = [[UILabel alloc] initWithFrame:CGRectMake(60,
210, 150, 30)];
sampletext.opaque = NO;
sampletext.backgroundColor = [UIColor redColor];
sampletext.font = [UIFont fontWithName:@"Helvetica" size:14];

sampletext.text = @"Sample photo details";

[self addSubview:sampletext];

if (caption) {
if (!_captionLabel) {
_captionLabel = [[TTLabel alloc] init];
_captionLabel.opaque = NO; = _captionStyle ? _captionStyle :
//_captionLabel.alpha = _hidesCaption ? 0 : 1;
[self addSubview:_captionLabel];

_captionLabel.text = caption;
[self setNeedsLayout];

I am beginner in ios programming so any sample code is appreciated.
Thanks a lot.
Reply all
Reply to author
0 new messages