2013-02-08 3 views

ответ

0

Вы можете добавить любой пользовательский компонент, который расширяет android.app.Preference

Или, если это должно быть View - создать макет, но вы должны включать в себя ListView с android.R.id.list в макете для PreferenceScreen

<RelativeLayout 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     xmlns:tools="http://schemas.android.com/tools" 
     android:id="@+id/layout_content" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="@color/background_color" > 

    <YourCustomComponentView 
     android:id="@+id/view" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentTop="true"/> 

    <ListView 
     android:id="@android:id/list" 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:layout_below="@+id/view" 
     android:layout_alignParentBottom="true"/> 

</RelativeLayout> 

Просто установитеContentView(), прежде чем добавлять какие-либо предпочтения.

Смежные вопросы