开发者

Scroll through XML content example

Can someone point me to an Android example with source that allows the user to scroll through the contents of an xml file that contains text entries (preferrably with arrows on the side of the screen that allow previous/next type of interaction)

I've looked through the examples on the Android site and didn't see anything simila开发者_Python百科r. Any help would be GREATLY appreciated (I'm an Android newbie but experienced Java developer)


I seriously doubt you are going to find a nice Android walkthrough of exactly the problem you are trying to solve, so you'll probably need to extrapolate from a few different guides.

Parsing xml is not substantially different from parsing xml anywhere else. This guide talks through the 3 different ways of doing so. Depending on how large your xml is, you can decide which makes the most sense for you.

In terms of UI, not sure exactly what you are looking for, but a ListView is often a good way to display large chunks of data. See Hello ListView.

Or, if you want a single text area that scrolls with 2 buttons, see ScrollView api. Its pretty simple. Common Layout Objects is a good guide to basic layout. You could probably accomplish what you want with a few nested LinearLayouts, or a RelativeLayout. If you post an attempt, people can help you fix it up.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜