ios - I'm trying to get a UILabel to scroll inside of a UIScrollView but it doesnt scroll -
this in .m
- (void)viewdidload { [super viewdidload]; [self.scrollview addsubview:self.contentview]; self.scrollview.contentsize = self.contentview.bounds.size; nsnumberformatter *numberformatter = [[nsnumberformatter alloc] init]; nsmutablearray *arr = [[nsmutablearray alloc]init]; arr = [singleton getarray]; nsstring *str = [arr componentsjoinedbystring:@"\n"]; summarylabel.text = str; }
this in .h
@interface totalviewcontroller : uiviewcontroller { uiscrollview *scrollview; uiview *contentview; } @property (nonatomic, retain) iboutlet uiscrollview * scrollview; @property (nonatomic, retain) iboutlet uiview * contentview; @property (nonatomic,strong) iboutlet uilabel * summarylabel;
my label connected view controller, contentview connected view controller, , summarylabel connected view controller. need label scroll , not.
a simple answer, if want single scrollable label, use uitextview instead (reference). disable editing, , scrollable label.
(taken verbatim from: how add scroll function uilabel)
Comments
Post a Comment