我将 SherlockPreferenceActivity 用于 xml 文件中的 Preference 活动。下面的代码:
public class Setting extends SherlockPreferenceActivity
{
protected void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
addPreferencesFromResource(R.xml.setting);
}
一切正常,但我需要左右边距为 0dip(下图)
我曾尝试在 ABS 源代码中查找,但未能自定义它。有人以前做过吗?
更新:我上传了更多细节图片
setting.xml 内容:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
<PreferenceCategory android:title="@string/system_setting" >
<CheckBoxPreference
android:defaultValue="true"
android:key="mode_on_off"
android:summaryOff="Sub Setting 1"
android:summaryOn="Sub Setting 1 On"
android:title="Setting 1" />
<CheckBoxPreference
android:defaultValue="true"
android:key="filter_on_off"
android:summaryOff="Sub Setting 2"
android:summaryOn="Sub Setting 2 On"
android:title="Setting 2" />
<CheckBoxPreference
android:defaultValue="false"
android:key="screen"
android:summaryOff="Sub Setting 3"
android:summaryOn="Sub Setting 3 on"
android:title="Setting 2" />
</PreferenceCategory>
</PreferenceScreen>