我是一位新的开发者。偏好设置之间的空间很大,看起来不太好看。我有一个定义好的偏好设置布局文件。如何将它们设得更紧凑些呢?非常感谢!
preferences.xml
<PreferenceCategory
android:title="@string/title_user_profile"
android:key = "@string/preference_key_category_usersetting"
android:layout="@layout/preference_layout">
<Preference android:title="@string/user_email_address"
android:key="@string/preference_key_email"
android:summary="@string/summary_joined_from"
android:editable="false"
android:clickable="false"
android:lineSpacingExtra="-4dp"/>
<com.ipretii.app.activity.setting.NamePreference
android:key="@string/preference_key_username"
android:summary="Type in your user name"
android:lineSpacingExtra="-4dp"/>
<com.ipretii.app.activity.setting.BirthYearPickerPreference
android:title="Birth Year"
android:key="@string/preference_key_birthyear"
android:lineSpacingExtra="-4dp"/>
</PreferenceCategory>
preference_layout.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:id="@+android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/text_size_title"
android:textColor="@color/colorPrimary"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="16dp"/>
<TextView android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/text_size_subheading"
android:textColor="@color/colorSubHeadingText"
android:paddingRight="16dp"/>
</LinearLayout>