首选项中的列表视图
我为我的 Android 应用程序 (Honeycomb) 创建了一个自定义首选项屏幕,其中包含一个 ListView。
public class XXXPreferences extends Preference
{
@Override
protected View onCreateView(ViewGroup parent)
{
ListView...
}
}
一切都按预期显示,但 ListView 没有滚动。看来是因为 Preference 类内置在 ScrollView 中,而 ListView 不支持嵌入到 ScrollView 中。
所以我想知道是否可以删除 Preference 类的 ScollView 或者是否还有其他技巧可以使事情正常工作!?
预先感谢您的回复:) 干杯
I've created a custon preference screen for my Android application (Honeycomb), that contains a ListView.
public class XXXPreferences extends Preference
{
@Override
protected View onCreateView(ViewGroup parent)
{
ListView...
}
}
Everyting is shown as expected, but the ListView is not scrolling. It seems that it is because the Preference class has a build in ScrollView and the ListView does not supported to be embedded in a ScrollView.
So I would like to know if it is possible to remove the ScollView of the Preference class or if there is another trick to make things work !?
Thanks in advance for your response :)
Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果首选项类有滚动视图,则不需要 ListView。只需使用垂直 LinearLayout 并根据需要添加布局即可。
If the preference class has a scrollview, you shouldn't need your ListView. Just use a vertical LinearLayout and add your layouts to that as needed.