Редактировать: Мне нужно использовать клавиатуру, но она скрывает мой EditText
, мне нужно ее прокручивать, чтобы клавиатура не скрывала ее.Клавиатура скрывается Редактирование текста в фрагментах
Я использую планшет Samsung.
Мой стиль:
parent="android:Theme.Holo.NoActionBar.Fullscreen"
The EditText
полей в прокруткой зрения, например, так:
Фрагмент макета:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin">
<ScrollView
android:layout_height="wrap_content"
android:layout_width="match_parent">
<LinearLayout
android:layout_height="match_parent"
android:layout_marginBottom="20dp"
android:layout_width="match_parent"
android:orientation="vertical">
<TextView
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:text="@string/depot_code"/>
<EditText
android:hint="@string/enter_depot_code"
android:id="@+id/etlocationId"
android:imeOptions="actionNext"
android:inputType="number"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:lines="1"
android:maxLength="12"
android:singleLine="true">
<requestFocus/>
</EditText>
<TextView
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:text="@string/name"/>
<EditText
android:hint="@string/enter_name"
android:id="@+id/etname"
android:imeOptions="actionNext"
android:inputType="textPersonName"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:lines="1"
android:maxLength="24"
android:singleLine="true"/>
<TextView
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:text="@string/street"/>
<EditText
android:hint="@string/enter_street"
android:id="@+id/etstreet"
android:imeOptions="actionNext"
android:inputType="textPostalAddress"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:lines="1"
android:maxLength="24"
android:singleLine="true"/>
<TextView
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:text="@string/suburb"/>
<EditText
android:hint="@string/enter_suburb"
android:id="@+id/etsuburb"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:lines="1"
android:maxLength="24"
android:singleLine="true"/>
<TextView
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:text="@string/state"/>
<Spinner
android:focusable="true"
android:focusableInTouchMode="true"
android:id="@+id/spinner"
android:imeOptions="actionNext"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_width="fill_parent"
android:spinnerMode="dropdown"/>
<TextView
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:text="@string/phone"/>
<EditText
android:hint="@string/enter_phone"
android:id="@+id/etphone"
android:imeOptions="actionDone"
android:inputType="phone"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:lines="1"
android:maxLength="12"
android:singleLine="true"/>
<Button
android:id="@+id/btnadd"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:text="@string/add"/>
</LinearLayout>
</ScrollView>
</FrameLayout>
Компоновка активность:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tech_controller"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin">
< .../ Layouts. ../>
<FrameLayout
android:id="@+id/second"
android:layout_height="match_parent"
android:layout_width="fill_parent"/>
</LinearLayout>
Были заданы одинаковые вопросы, но я не нашел ответа, который работает.
У меня есть проект, который использует много фрагментов, связанных с одним действием. В моем манифесте для деятельности у меня есть:
android:windowSoftInputMode="stateHidden"
Некоторые фрагменты требуют ввода данных пользователем.
В макете фрагмента я использую:
Каждый фрагмент вложен следующим образом:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent" .../>
<ScrollView
android:layout_height="match_parent"
android:layout_width="match_parent">
<LinearLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical">
<EditText
android:imeOptions="actionNext"
or
android:imeOptions="actionDone" .../>
Это хорошо работает. EXCEPT клавиатура скрывает EditTexts, которые расположены ниже на странице.
Я прочитал это снова и снова:
http://developer.android.com/reference/android/widget/TextView.html#attr_android:imeOptions
Пытались эти предложения, но клавиатура становится видимым, когда активность называется, что я не хочу. Он также не работает. Может быть, потому что это фрагмент?
Android Keyboard hides EditText
Я пытался разработать динамичное решение. Любая помощь приветствуется.
Редактировать: Это используется для использования на планшетах, и есть только одна опция клавиатуры с изменениями языка.
Edit: МОЕ РЕШЕНИЕ
Я решил его, установив другую экранную клавиатуру.https://code.google.com/p/softkeyboard/wiki/HowTo
Вы можете предоставить себе снимок экрана? – petey
@petey screenshot добавлен –
У IME, который вы использовали, есть собственный плавающий макет, можете ли вы попробовать свой код со встроенными IME, такими как Google Keyboard, или настроить IME на нормальный макет полной ширины? – Yenchi