XML、preferenceFragment、および左側のナビゲーションから作成された設定があります。「設定」を選択すると、優先フラグメントが出てきます...DPadを使用して上下に移動できます。下部に選択肢がなくなると、カーソルが停止します(望ましい動作)が、リストを上に移動すると、カーソルは左側のナビゲーションに続きます。上で止めてほしい。以下は私の pref_screen xml です。私の左側のナビはコード側で作成されています。これに DPad ロジックを組み込む方法がわかりません。また、設定フラグメントの場合、DPad がカーソルを左側のナビゲーション メニューに移動しないように制限したいと考えています。
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:key="main_pref">
<PreferenceCategory
android:title="@string/units">
<ListPreference
android:key="pref_unit_temp"
android:title="@string/temperature"
android:defaultValue="@string/default_metric"
android:entries="@array/pref_temp_units"
android:entryValues="@array/pref_temp_units_values"
android:dialogTitle="@string/units"
android:layout="@layout/settings_item" />
</PreferenceCategory>
<PreferenceCategory
android:title="@string/advanced">
<ListPreference
android:key="pref_speed"
android:title="@string/speed"
android:entries="@array/pref_speed"
android:entryValues="@array/pref_speed_values"
android:defaultValue="@string/default_metric"
android:layout="@layout/settings_item"/>
<ListPreference
android:key="pref_measurement"
android:title="@string/measurement"
android:entries="@array/pref_measurement"
android:entryValues="@array/pref_measurement_values"
android:defaultValue="@string/default_metric"
android:layout="@layout/settings_item"/>
<ListPreference
android:key="pref_time"
android:title="@string/time_format"
android:entries="@array/pref_time"
android:entryValues="@array/pref_time_values"
android:defaultValue="@string/default_metric"
android:layout="@layout/settings_item"/>
<ListPreference
android:key="pref_date"
android:title="@string/date_format"
android:entries="@array/pref_date"
android:entryValues="@array/pref_date_values"
android:defaultValue="@string/default_metric"
android:layout="@layout/settings_item"/>
</PreferenceCategory><!--
<PreferenceCategory
android:title="Weather Notification Bar">
<CheckBoxPreference
android:key="pref_notification_enable"
android:title="Enable Notifications"
android:summary="Turn on/off status bar weather notifications"
android:defaultValue="true"
android:enabled="false"/>
<ListPreference
android:key="pref_notification_update_method"
android:dependency="pref_notification_enable"
android:title="Choose notification update method"
android:summary="Manual, Automatic, Interval"
android:entries="@array/pref_notification_update_method"
android:entryValues="@array/pref_notification_update_method_values"
android:dialogTitle="Update Method" />
<ListPreference
android:key="pref_notification_interval"
android:title="Interval to update"
android:dependency="pref_notification_enable"
android:summary="Use this to set the update interval if interval method is selected"
android:entries="@array/pref_notification_interval"
android:entryValues="@array/pref_notification_interval_values"
android:dialogTitle="Update Interval" />
</PreferenceCategory>
-->
<!--<PreferenceCategory
android:title="Background">
<CheckBoxPreference
android:key="background_enabled"
android:title="Enable Interactive Background"
android:summary="Turn off to improve performance"
android:defaultValue="true"
android:enabled="true"/>
</PreferenceCategory>
--><PreferenceCategory
android:title="AccuWeather">
<!-- <PreferenceScreen
android:title="@string/call_us"
android:summary=""
android:layout="@layout/settings_item">
<intent android:action="android.intent.action.DIAL"
android:data="tel:8142358650" />
</PreferenceScreen>
<PreferenceScreen
android:title="@string/email_us"
android:summary="customerservice@accuweather.com"
android:layout="@layout/settings_item">
<intent android:action="com.accuweather.android.tablet.EMAIL_ACCUWX"
/>
<intent android:action="android.intent.action.SENDTO"
android:data="customerservice@accuweather.com"/>
</PreferenceScreen> -->
<PreferenceScreen
android:title="@string/terms_conditions"
android:summary=""
android:layout="@layout/settings_item">
<intent android:action="android.intent.action.VIEW"
android:data="http://www.accuweather.com/m/EULA.aspx" />
</PreferenceScreen>
</PreferenceCategory>
</PreferenceScreen>
スクリーンショットは次のとおりです。