如何包装到内容Android首选项汇总值?

问题描述 投票:3回答:1

如何增加(包含内容)首选项汇总值的大小?

它目前最多显示105个字符。

android preferences summary
1个回答
0
投票

通过添加到我的EditTextPreferences解决了它:

android:layout="@layout/edit_text_preference_layout"

并将标准Android布局XML复制到我自己的布局文件(edit_text_preference_layout.xml)并进行一些更改(即删除maxlines属性并更改字体大小和边距以完全匹配其他优先级(出于某种原因,sdk中的preferences.xml) 7和19都有值使受影响的pref看起来与我在屏幕上的标准prefs有点不同):

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="8dip"
    android:layout_marginRight="6dip"
    android:layout_marginTop="6dip"
    android:layout_marginBottom="6dip"
    android:layout_weight="1">

    <TextView android:id="@+android:id/title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:singleLine="true"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:ellipsize="marquee"
        android:fadingEdge="horizontal" />

    <TextView android:id="@+android:id/summary"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@android:id/title"
        android:layout_alignLeft="@android:id/title"
        android:textAppearance="?android:attr/textAppearanceSmall"/>

</RelativeLayout>

<!-- Preference should place its actual preference widget here. -->
<LinearLayout android:id="@+android:id/widget_frame"
    android:layout_width="wrap_content"
    android:layout_height="fill_parent"
    android:gravity="center_vertical"
    android:orientation="vertical" />

所以,如果你有其他偏好 - 它们的布局也应该改变,所以在prefs屏幕上一切看起来都是一致的。

© www.soinside.com 2019 - 2024. All rights reserved.