Я использую SharedPreferences в своем приложении для Android стандартным способом. На устройстве HTC WildFire (разрешение 240x320) EditText сжимается при отображении виртуальной клавиатуры.
Кто-нибудь еще сталкивался с этим, есть ли решение? Я был в тупике в течение нескольких дней.
Мой код/XML довольно прост:
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"));
}
}
И мои предпочтения.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>