Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 不自动显示软纸板_Android_Material Design - Fatal编程技术网

Android 不自动显示软纸板

Android 不自动显示软纸板,android,material-design,Android,Material Design,在我的xml布局中: <com.google.android.material.textfield.TextInputEditText android:id="@+id/nameTextInputEditText" style="@style/textViewOneLine" android:layout_width="0dp" android:layout_height="wrap_con

在我的xml布局中:

  <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/nameTextInputEditText"
            style="@style/textViewOneLine"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/default_margin"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:hint="@string/name"
            android:textColor="@android:color/white"
            android:textColorHint="@android:color/white"
            android:textSize="17sp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/toolBarContainer" />

尽管如此,这应该是可行的

确保父布局不是可聚焦模式。还要确保父布局是相对布局或线性布局

如果所有这些都失败,请尝试以下操作: 将此添加到onCreate after setContentView中的主活动中。让我们看看会发生什么

InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);

尝试将其添加到xml布局中

android:focusedByDefault="true"

可能的重复在重复的问题中有很多解决方案,我建议它的影响较小我使用API=23,所以不能使用android:focusedByDefault
android:focusedByDefault="true"