使用默认xml属性复制Android首选项屏幕样式
我已经对此进行了研究,但我在任何地方都找不到正确的答案……我正在尝试使我的应用程序的“帮助”UI看起来与默认Android的默认“首选”UI相似 关于如何获取Preferences屏幕使用的属性(例如textsize、textapparenceattribute等)有什么想法吗使用默认xml属性复制Android首选项屏幕样式,android,xml,user-interface,Android,Xml,User Interface,我已经对此进行了研究,但我在任何地方都找不到正确的答案……我正在尝试使我的应用程序的“帮助”UI看起来与默认Android的默认“首选”UI相似 关于如何获取Preferences屏幕使用的属性(例如textsize、textapparenceattribute等)有什么想法吗 谢谢你的帮助 那么,您可以下载Android SDK并查看所有Android默认布局所在的“/SDK/platforms/Android xx/data/res/layout” 以下是您可能感兴趣的文件名: prefer
谢谢你的帮助 那么,您可以下载Android SDK并查看所有Android默认布局所在的“/SDK/platforms/Android xx/data/res/layout” 以下是您可能感兴趣的文件名:
preference_category_holo.xml
preference_category.xml
preference_child_holo.xml
preference_child.xml
preference_dialog_edittext.xml
preference_header_item.xml
preference_holo.xml
preference_information_holo.xml
preference_information.xml
preference_list_content_single.xml
preference_list_content.xml
preference_list_fragment.xml
preferences.xml
preference_widget_checkbox.xml
preference_widget_seekbar.xml
preference_widget_switch.xml
preference.xml
下面是首选项列表XML的示例:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_height="match_parent"
android:layout_width="match_parent">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1">
<LinearLayout
android:id="@+id/headers"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView android:id="@android:id/list"
style="?attr/preferenceFragmentStyle"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1"
android:drawSelectorOnTop="false"
android:scrollbarStyle="@integer/preference_fragment_scrollbarStyle"
android:cacheColorHint="@android:color/transparent"
android:listPreferredItemHeight="48dp"
android:scrollbarAlwaysDrawVerticalTrack="true" />
<FrameLayout android:id="@+id/list_footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0" />
</LinearLayout>
</LinearLayout>
<RelativeLayout android:id="@+id/button_bar"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_weight="0"
android:visibility="gone">
<Button android:id="@+id/back_button"
android:layout_width="150dip"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:layout_alignParentLeft="true"
android:text="@string/back_button_label"
/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true">
<Button android:id="@+id/skip_button"
android:layout_width="150dip"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:text="@string/skip_button_label"
android:visibility="gone"
/>
<Button android:id="@+id/next_button"
android:layout_width="150dip"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:text="@string/next_button_label"
/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
像这样的吗?还有?@user2943342,是的,我也需要同样的东西,我自己研究了2天左右。如果您喜欢我的答案,请单击答案顶部的“向上箭头”标志进行向上投票。如果你觉得它真的回答了你的问题,你甚至可以重新接受它。和平!