作者:铁血aaaaaaaaaaaaa_295 | 来源:互联网 | 2023-05-19 10:17
ImdevelopingmyfirstAndroidapplication,andIdliketocreateasettingsscreen.我正在开发我的第一个An
I'm developing my first Android application, and I'd like to create a settings screen.
我正在开发我的第一个Android应用程序,我想创建一个设置屏幕。
I'd like the screen to have a similar look-and-feel as the native phone-settings screens and the native "create/edit alarm" screen. Thus with different kinds of (statically defined) items vertically stacked with a thin line between them.
我希望屏幕具有与本机手机设置屏幕和本机“创建/编辑警报”屏幕类似的外观和感觉。因此,不同种类的(静态定义的)物品垂直地堆放在它们之间的一条细线上。
How do I define such screen?
如何定义这样的屏幕?
I understand I can use the ListView, but this seems to be primarily meant for serving dynamic data using a ListAdapter, where each item is served in the same format. It seems to be possible to create different items (that is, some with checkbox, some with two text-lines, some with an icon) by creating my own ListAdapter and overriding getView but this seems like overkill. Should I be using a ListView for this purpose?
我知道我可以使用ListView,但这似乎主要是为了使用ListAdapter来服务动态数据,每个条目都以相同的格式提供服务。通过创建自己的ListAdapter并覆盖getView,似乎可以创建不同的项(即,有些带有复选框,有些带有两个文本行,有些带有图标),但这似乎有些过头了。为此,我应该使用ListView吗?
2 个解决方案