У меня есть просмотрщик с 2 страницами. На странице 2 у меня есть 6 Editexts для ввода текста. Я хочу показать sortkeyboard, когда переключусь на страницу 2. Я пробовал много решений, но это не помогло мне.Мягкая клавиатура не отображается автоматически при просмотре андроида плеера
Вот мой макет:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:background="@color/background_splash"
android:orientation="vertical">
<ImageView
android:id="@+id/imgLogo"
android:layout_width="@dimen/logo_height_primary"
android:scaleType="centerInside"
android:layout_height="@dimen/logo_height_primary"
android:layout_marginTop="20dp"
android:layout_gravity="center"
android:src="@mipmap/ic_logo" />
<TextView
android:id="@+id/tvHint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="50dp"
android:text="@string/tip_enter_otp"
android:textColor="#222222"
android:textSize="14sp" />
<LinearLayout
android:id="@+id/lnOtp"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_gravity="center"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<Editext
android:id="@+id/edtOTP1"
android:layout_width="@dimen/edt_otp_layout_width"
android:layout_height="match_parent"
android:textSize="@dimen/text_otp_size"
android:gravity="center"
android:padding="@dimen/text_otp_padding"
android:layout_marginRight="@dimen/edt_otp_horizontal_margin"
android:background="@drawable/background_textbox_otp"
android:inputType="numberDecimal"
android:maxLength="1"
android:textAlignment="center"
android:textColor="@android:color/black" />
<Editext
android:id="@+id/edtOTP2"
android:layout_width="@dimen/edt_otp_layout_width"
android:layout_height="match_parent"
android:textSize="@dimen/text_otp_size"
android:padding="@dimen/text_otp_padding"
android:layout_marginRight="@dimen/edt_otp_horizontal_margin"
android:background="@drawable/background_textbox_otp"
android:inputType="numberDecimal"
android:maxLength="1"
android:textAlignment="center"
android:textColor="@android:color/black" />
<Editext
android:id="@+id/edtOTP3"
android:layout_width="@dimen/edt_otp_layout_width"
android:layout_height="match_parent"
android:textSize="@dimen/text_otp_size"
android:padding="@dimen/text_otp_padding"
android:layout_marginRight="@dimen/edt_otp_horizontal_margin"
android:background="@drawable/background_textbox_otp"
android:inputType="numberDecimal"
android:maxLength="1"
android:textAlignment="center"
android:textColor="@android:color/black" />
<Editext
android:id="@+id/edtOTP4"
android:layout_width="@dimen/edt_otp_layout_width"
android:layout_height="match_parent"
android:textSize="@dimen/text_otp_size"
android:padding="@dimen/text_otp_padding"
android:layout_marginRight="@dimen/edt_otp_horizontal_margin"
android:background="@drawable/background_textbox_otp"
android:inputType="numberDecimal"
android:maxLength="1"
android:textAlignment="center"
android:textColor="@android:color/black" />
<Editext
android:id="@+id/edtOTP5"
android:layout_width="@dimen/edt_otp_layout_width"
android:layout_height="match_parent"
android:textSize="@dimen/text_otp_size"
android:padding="@dimen/text_otp_padding"
android:layout_marginRight="@dimen/edt_otp_horizontal_margin"
android:background="@drawable/background_textbox_otp"
android:inputType="numberDecimal"
android:maxLength="1"
android:textAlignment="center"
android:textColor="@android:color/black" />
<Editext
android:id="@+id/edtOTP6"
android:layout_width="@dimen/edt_otp_layout_width"
android:layout_height="match_parent"
android:textSize="@dimen/text_otp_size"
android:padding="@dimen/text_otp_padding"
android:background="@drawable/background_textbox_otp"
android:inputType="numberDecimal"
android:maxLength="1"
android:textAlignment="center"
android:textColor="@android:color/black" />
</LinearLayout>
</LinearLayout>
Спасибо ребята
, какие решения ты пробовал? –