如何在android中滚动屏幕
我正在学习安卓。我创建了一个简单的 xml 屏幕,但数据超出屏幕并且屏幕不滚动。任何人都可以告诉我如何使我的手机屏幕可滚动吗?
I'm learning the android. I created a simple xml screen but data is going out of screen and the screen is not scrolling. Can any body tell me how to make scrollable my phone screen?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
将其放入
ScrollView
http://developer.android .com/reference/android/widget/ScrollView.html
Put it inside a
ScrollView
http://developer.android.com/reference/android/widget/ScrollView.html
以下是固定页眉和固定页脚以及滚动正文的一些代码:
玩得开心。
Here is some code for a fixed header and fixed footer and a scrolling body:
Have fun.
让你的 Activity 成为 ListActivity
下面是一个实现 listView / ListActivity 的示例
http://p-xr.com/android-tutorial-how-to-parseread-xml-data-into-android-listview/
滚动到帖子底部即可找到Eclipse 项目查看完整的实现。
您还可以使用 http://developer.android.com/reference/android/小部件/ScrollView.html
Make your Activity a ListActivity
Here is an example that implements a listView / ListActivity
http://p-xr.com/android-tutorial-how-to-parseread-xml-data-into-android-listview/
Scroll to the bottom of the post to find the Eclipse project to see the full implementation.
You can also use a http://developer.android.com/reference/android/widget/ScrollView.html
将整个布局放入scrollView.ie最顶层/父布局是scrollview
Puth the whole layout inside scrollView.i.e the topmost/parent layout is scrollview
只需将此代码放入您的 AndroidManifest.xml 活动中
Just put this code in your activity of AndroidManifest.xml