在我的 iPhone 应用程序上显示网页内容的最佳方式(如果可能而不使用 UIWebView)
我想构建一个 iPhone 应用程序,除其他外,它应该显示网站详细信息页面的一些内容。该内容包括a)标题b)图像c)文本段落(有多个段落。
我做了一个简短的研究,发现最简单的方法是使用uiwebview。问题是在那种情况下我必须不断与网站负责人联系才能为 iPhone 客户端创建修改后的 html/css 版本,
因此我想知道是否有可行的替代方案可以获取我想要的数据。也许我使用包含标题的 UILabel、图像的 UIImage 和文本段落的 UIScrollView 格式?但问题是如何设置 UIscrollview 内容大小,因为它依赖于大小。 我是一名 iPhone 开发新手
,我可能在这里遗漏了一些明显的东西,所以如果有人能指出我正确的方向,我将非常感激。
I want to build an iPhone app that should , among other things, display the some content of a website's detail pages. This content includes a)a title b) an image c) a text passage (with multiple paragraphs.
I have done a brief research and found out that the easiest way to do this is by using uiwebview. The problem is that in that scenario I would have to be constantly in touch with the person responsible for the website in order to create a modified html/css version for the iPhone client.
As a result I was wondering if there is a feasible alternative. I can get the data I want in json format with HTML Requests. Maybe if I used a UIScrollView that contains a UILabel for the title, a UIImage for the image and another UILabel for the text passage? But the problem is how to set the UIscrollview content size since it dependent on the size of the text passage?
I am a iPhone dev noob and I am possibly missing something obvious here so I would be very greatful if someone could point me in the right direction.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来你正在别人的内容上构建一个应用程序。如果这是合法的,那么其他网站应该有一个已发布的 api,您可以在其中开始编写应用程序。获取 json 或 xml,然后使用
UIImageView
将它们填充到UIViewController
中以显示图像,使用UITextView
显示文本。UITextView
已经有一个内置的滚动条,所以你不需要UIScrollView
Sounds like you are building an app ontop of somebody elses content. Provided this is legal, this other site should have a published api where you can start to write your app. Get the json or xml, then populate them in a
UIViewController
using aUIImageView
to display the image,UITextView
for the text. TheUITextView
already has a built in scroller so you dont need aUIScrollView