hi,
seem having strange problem. can see in code below, have image view supposed show in background of uitableview when view controller's view loaded. reason, whether background image view creation code placed in viewdidload or viewdidappear, background image won't show until after tap 1 of table view's cells.
here's code:
code:
- (void)viewdidload { [super viewdidload]; nsstring *roadimagepath = [[nsbundle mainbundle] pathforresource:@"word family app screen blank road" oftype:@"png"]; cgrect tableviewframe = [self.tableview frame]; cgrect roadviewframe = (cgrect){cgpointzero,tableviewframe.size}; roadviewframe.size.height = 300; uiimage *image = [uiimage imagewithcontentsoffile:roadimagepath]; uiimageview *imageview = [[uiimageview alloc] initwithimage:image]; [imageview setframe:roadviewframe]; [imageview setuserinteractionenabled:false]; [self.tableview setbackgroundview:imageview];
please help, , thank you!
please me!
have 2 ideas, neither of particularly desirable:
1) use nib file & subclass of uitableview
2) create uiview, put table view & image view in view, , send image view back.
Forums iPhone, iPad, and iPod Touch iOS Programming
- iPhone
- Mac OS & System Software
- iPad
- Apple Watch
- Notebooks
- iTunes
- Apple ID
- iCloud
- Desktop Computers
- Apple Music
- Professional Applications
- iPod
- iWork
- Apple TV
- iLife
- Wireless
Comments
Post a Comment