开发者

Iphone uiwebview and uitableview together possible?

开发者 https://www.devze.com 2023-03-19 10:04 出处:网络
I have a UITableView which is long and scrollable, also I use UINAvigationController. At the bottom of the page in the footer I plan to put a next button which will help to go next page.

I have a UITableView which is long and scrollable, also I use UINAvigationController. At the bottom of the page in the footer I plan to put a next button which will help to go next page.

The problem is "sometimes" this page may need to show some messages in html, so I must use uiwebview preferebaly at the bottom of the page just above the footer, it shouldnt get effected from scrolling.

-Can I use uitableview and uiwebview on same page? the page is alrea开发者_如何转开发dy in control of a uitableview controller, so how will i control or put delegates of a uiwebview?

-Can I make this uiwebview invisible and not allocate space when there are no messages to be shown?


Yes, it's possible.

I believe the Stocks app for the iPhone utilizes multiple views with their own controllers. I think a better solution would be is to have a UIPageControl and create a UITableViewController when the UIPageControl's value changed.

If you still want to create UINavigationController, just set its rootViewController to a UITableViewController and set its toolbarHidden property to NO, the toolbar has the behavior you want, it stays fixed on the bottom of the screen, if that's what you meant. Then add the navigational buttons.

As for UIWebView's, just dynamically create it once you get an error and set its hidden property to YES. You wouldn't want to be destroying and recreating UIWebViews every time you get an error as that can be very expensive. Just create once and hide it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号