J'utilise SharedPreferences dans mon application Android de manière standard. Sur l'appareil HTC WildFire (résolution 240x320), EditText est écrasé lorsque le clavier virtuel est affiché.SharedPreferences EditText boîte de dialogue écrasée sur HTC WildFire
Est-ce que quelqu'un d'autre est tombé sur cette solution? J'ai été perplexe pendant des jours.
Mon code/XML est assez simple:
public class PrefsActivity extends PreferenceActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preferences);
// don't display hidden preferences
getPreferenceScreen().removePreference(findPreference("hidden_prefs"));
}
}
Et mon preferences.xml:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="User Preferences">
<EditTextPreference
android:key="profile"
android:title="Profile"
android:summary="Your profile name"
android:name="Profile"/>
<EditTextPreference
android:key="password"
android:title="Password"
android:summary="Your password"
android:name="Password"
android:password="true"/>
<EditTextPreference
android:name="Server"
android:summary="The server to use"
android:title="Server"
android:key="server"/>
<EditTextPreference
android:name="Secret"
android:summary="The server secret"
android:title="Secret"
android:password="true"
android:key="secret"/>
<CheckBoxPreference
android:title="On Demand"
android:defaultValue="true"
android:summary="Check to enable On Demand"
android:key="on_demand"/>
<ListPreference
android:title="Date"
android:summary="Set the type of date used"
android:key="date"
android:defaultValue="next"
android:entries="@array/prefs_date_keys"
android:entryValues="@array/prefs_date_values" />
</PreferenceCategory>
<PreferenceCategory android:key="hidden_prefs" android:title="Hidden Preferences">
<EditTextPreference
android:name="Last Project ID"
android:summary="The last Project ID"
android:title="Last Project ID"
android:key="last_project_id"
android:inputType="number"/>
<EditTextPreference
android:name="Fast Sync"
android:summary="Use Fast Sync"
android:title="Fast Sync"
android:key="fast_sync"
android:inputType="number"/>
</PreferenceCategory>
Merci pour vos suggestions. Je ne veux pas casser l'apparence de l'application (en particulier pour les combinés autres que le HTC WildFire), donc je pense que je vais aller avec 2). Êtes-vous en mesure de fournir une référence sur la façon de le faire? Je pense que changer la taille de police du titre ou le remplissage sera la voie à suivre. –