J'ai quelques EditText
dans RecyclerView
qui est à l'intérieur d'un BottomSheetDialog
. Le problème que j'ai maintenant que lorsque BottomSheetDialog
est affiché à l'écran, je tape sur par exemple le 7 EditText
dans le RecyclerView
. Clavier virtuel apparaît et recouvre le EditText
, donc je ne peux pas voir ce que je tape. mais si je traînais le BottomSheetDialog
un peu haut, EditText
alors ne seront pas couverts par le clavier souple même si je tape sur la dernière EditText
à l'écran. RecyclerView
est certainement redimensionnée dans ce cas, mais ne redimensionne pas si je n'ai pas fait glisser BottonSheetDialog
un peu plus haut. une idée pourquoi? et comment je peux réparer ça?android clavier souple recouvre l'edittext dans recyclerview dans bottomsheet
Main.java
class VH extends RecyclerView.ViewHolder {
public VH(View itemView) {
super(itemView);
}
}
private void test() {
BSTest bsTest = new BSTest(this);
bsTest.setContentView(R.layout.bottomsheet_test);
RecyclerView rv = (RecyclerView) bsTest.findViewById(R.id.recyclerView);
rv.setLayoutManager(new LinearLayoutManager(this));
rv.setAdapter(new RecyclerView.Adapter() {
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
return new VH(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_edittext, parent, false));
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
}
@Override
public int getItemCount() {
return 20;
}
});
bsTest.show();
}
BSTest.java
public class BSTest extends BottomSheetDialog {
public BSTest(@NonNull Context context) {
super(context);
}
private BSTest(@NonNull Context context, @StyleRes int theme) {
super(context, theme);
}
private BSTest(@NonNull Context context, boolean cancelable, OnCancelListener cancelListener) {
super(context, cancelable, cancelListener);
}
}
bottomsheet_test.xml
<?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="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="1"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="2"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="3"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
item_edittext.xml
<?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="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="1"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="2"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="3"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
montre la capture d'écran i –
ajouté une courte vidéo – user1865027
@ user1865027 avez-vous trouvé le problème/solution au problème? –