views:

489

answers:

3

I want to make an e-book reader iPhone app. Should I use UITextView or UIWebView to display the text? Which control is used by other e-book readers?

A: 

hi,

U should use UIWEB view ,as to provide paragraph and other functions of text are not supported by text view, u can directly implement html code and can make the app with proper view of text. So my suggestion is to use web view.

iPhone Fun
U should use "you".
KennyTM
oh, uiwebview can scroll to the designated location?
HelloWorld
Yes, it can scroll to a designated location using javascript
justin
+2  A: 

I would use a UIWebView, as it gives you much more flexibility in the presentation of the text. According to the UITextView Class Reference:

This class does not support multiple styles for text. The font, color, and text alignment attributes you specify always apply to the entire contents of the text view. To display more complex styling in your application, you need to use a UIWebView object and render your content using HTML.

Also, UITextView uses scrolling to display large amounts of text (it inherits from UIScrollView); in an e-book reader, you will most likely want to paginate the content, so you will not want the scrolling behaviour.

Steve Harrison
+1  A: 

UIWebView is much better solution than UITextView mainly due to support of rich formatting of its contents. On the other hand you will miss some very important functions which you get for free while using UITextView. I'm talking mostly about searching inside, changing contents size etc. All of this is possible with UIWebView but it's not straightforward - css & javascript are for the help here

BobC