timpone
timpone

Reputation: 19969

is UIScrollView or a UIWebView the better solution for this?

I am spec'ing out an iOS app and there is a piece that is a run-on section that will need to scroll. I was thinking of doing it as a UIScrollView (have never used one but seems logical) but it sounds like the contentSize always needs to be calculated. This could be extremely variable in this case (UGC images etc...). Is this correct? Or is there a legitimate workaround? If not, would a UIWebView be the better solution?

The app functionality would be like a FB feed or Instagram. Is it known what they use (FB looks like UIWebView to me).

thx

Upvotes: 0

Views: 565

Answers (2)

Sakares
Sakares

Reputation: 606

In my experience , I have the client-side web application development experience before iOS development .For the first time, I though UIWebView is pretty easier than UIScrollView because I can handle html/css/javascript as my wish.

But I found some problem with UIWebView Performance. If you have complex functional usability and large amount of data loading. So I try to implement with UIScrollView, Of course, It's quite not easy for me to create complex View with UIScrollView but when I've been familiar with the implement instruction. I think UIScrollView have a better performance then UIWebView ,especially complex layout and usability.

I recommend you to use both of them base on situation.

For some simply ViewController that just display an information with less complicate use, UIWebView is fine if you have familiar client-side web application development.

For some complex usability, It may not easy to implement with UIScrollView but It's quite OK for performance issue.

Upvotes: 0

graver
graver

Reputation: 15213

Actually it depends on what you are trying to achieve. If you use the web view you will have to generate html code to feed it and if you have buttons, you probably have to generate more html/css/js to make everything work. Using the scroll view is not a pain... Calculating the content size is easy... All your elements' height + some offset between them. Its bounds will remain always the same, you should only set the content size.

Upvotes: 1

Related Questions