iOS UILabel in scrollview appears as block -
i novice objective-c , developing first app, notification-center widget, compiled "theos" .deb
its pretty straightforward: want create uiscrollview, scroll (horizontally) through multiple pages, added uiimage subviews scrollview. on 1 page add uibuttons uiimageview - works!
i tried, testing, uislider on - works!
all elements shown intended , can controlled, when add labels, no matter page, shows me white filled rect on left edge of uiimageview:
the code simple as:
creating scrollview in -(void)init
scrollview = [[uiscrollview alloc] initwithframe:cgrectmake(0, 0, view_width, view_height)]; scrollview.pagingenabled = yes; scrollview.userinteractionenabled = yes; scrollview.autoresizingmask = uiviewautoresizingflexiblewidth; scrollview.showshorizontalscrollindicator = no;
creating page subview in -(void)loadfullview
page0 = [[uiimageview alloc] initwithimage:stretchablebgimg]; page0.frame = cgrectmake(pageview_offset, 0.0f, view_width-2*pageview_offset, view_height); page0.autoresizingmask = uiviewautoresizingflexiblewidth; page0.userinteractionenabled = yes;
somewhere later:[scrollview addsubview:page0]; [_view addsubview:scrollview];
creating label , adding page
uilabel* label = [[uilabel alloc] initwithframe:cgrectmake(pageview_offset,0,view_height/2,view_width-2*pageview_offset)]; label.text = @"message"; [page0 addsubview:label]; [label release];
what missing? appreciated!
Comments
Post a Comment