Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/haskell/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 这些偏好看起来很奇怪?(向右移一点,字体大一点)_Android_Preference - Fatal编程技术网

Android 这些偏好看起来很奇怪?(向右移一点,字体大一点)

Android 这些偏好看起来很奇怪?(向右移一点,字体大一点),android,preference,Android,Preference,我不知道为什么DialogPreference创建的项目的位置会是 向右移动一点,字体大小。。。大一点 我有一个类NumberPickerPreference,它扩展了DialogPreference package com.example public class NumberPickerPreference extends DialogPreference{ ...... } 和pref_general.xml作为首选项 <PreferenceScreen

我不知道为什么DialogPreference创建的项目的位置会是 向右移动一点,字体大小。。。大一点

我有一个类NumberPickerPreference,它扩展了DialogPreference

package com.example
public class NumberPickerPreference extends DialogPreference{
          ......
}
和pref_general.xml作为首选项

  <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
  <PreferenceCategory
    android:title="@string/header_system">

    <!-- extends DialogPreference -->
    <com.example.NumberPickerPreference
        android:key="@string/key_refresh"          
        android:title="@string/title_refresh_time"
        android:dialogTitle="@string/title_refresh_time"
        android:summary="@string/summary_refresh_time"         
        android:negativeButtonText="@string/ui_cancel"
        android:positiveButtonText="@string/ui_ok" />


    <CheckBoxPreference   
        android:title="@string/title_reconnect_unlimit" 
        android:key="@string/key_reconnect_unlimit"
        android:summaryOn="@string/summary_reconnect_unlimit"  
        android:summaryOff="@string/summary_reconnect_unlimit"   
        android:disableDependentsState="true" />

  </PreferenceCategory>
  </PreferenceScreen>
public class SettingsActivity extends Activity {
   @Override
    protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          getFragmentManager().beginTransaction().replace(android.R.id.content, new GeneralPreferenceFragment()).commit();          
    }


    public static class GeneralPreferenceFragment extends PreferenceFragment {
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);                     
            addPreferencesFromResource(R.xml.pref_general);
        }
    }
}