Android 如何调整首选项屏幕标题的大小?

Android 如何调整首选项屏幕标题的大小?,android,preferencescreen,Android,Preferencescreen,属性设置为首选项屏幕,但没有帮助。非常感谢您的帮助。与中一样,您可以为首选项屏幕创建自定义布局,并使用android:layout属性应用它 android:layout_height="wrap_content" android:layout_width="wrap_content" 首选项\u title.xml布局 <PreferenceScreen xmlns:android="http://schemas.android.c

属性设置为
首选项屏幕
,但没有帮助。非常感谢您的帮助。

与中一样,您可以为
首选项屏幕创建自定义布局,并使用
android:layout
属性应用它

android:layout_height="wrap_content"
android:layout_width="wrap_content"

首选项\u title.xml布局

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
                  android:layout="@layout/preference_title"
                  android:title="@string/game_title">


并创建不同版本的
res/values/dimen.xml
文件,使标题文本大小(
@dimen/preference\u title
)的值与可能的屏幕宽度成比例。。通常,您将拥有不同版本的
目录,例如,对于w600dp的屏幕宽度,您将拥有
值-w600dp
目录。

谢谢您的回答!!这很有帮助。在将窗口大小拖动到自定义大小的过程中,我遇到了拆分屏幕的问题。在dimen.xml中添加值仍然有帮助吗?@TomTaylor从逻辑上讲,如果您选择与屏幕大小相比合适的文本大小,则会有帮助,我无法在模拟器上尝试,因为它不支持缩小布局的弹出视图。。让我明天在物理设备和反馈上试试。。谢谢你的好话!:)@TomTaylor现在刚刚测试了它,并且无缝地工作了。。虽然我看不到和你一样的问题。。但是调整弹出视图的大小会改变文本的大小。非常感谢。这很好用!这是由于其他布局和堆叠在
首选项屏幕中的其他布局
正如您所说,我尝试使用简单的文本视图和后退按钮图像(导航到上一个屏幕),使用线性布局-它工作得非常好。再次非常感谢!!!
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
                  android:layout="@layout/preference_title"
                  android:title="@string/game_title">
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@android:id/title"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textSize="@dimen/preference_title"/>