Hallo,
ich hab ein Bottomsheet, darin befinden sich EditTexte und wenn man auf einen klickt
öffnet sich natürlich die Tastatur, allerdings über dem BottomSheet.
Ich habe es mit android:windowSoftInputMode="" adjustResize, adjustPan, stateVisible ... versucht,
weder im Manifest noch sonst wo hat es etwas verändert.
[Blockierte Grafik: https://www.bilder-upload.eu/upload/648fe7-1555602809.jpg]
Java: ScrollingActivity.java
private BottomSheetBehavior sheetCategory;
sheetCategory = BottomSheetBehavior.from(categorySheet);
sheetCategory.setPeekHeight(0);
Hier geht es um die Zeile: 128 bis 139 und im nächsten Quellcode Container könnt ihr sehen welche Datei inkludiert wird.
XML: activity_scrolling.xml
<android.support.v4.widget.NestedScrollView
android:id="@+id/bottom_sheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimaryHeller"
android:elevation="5dp"
android:fillViewport="true"
app:layout_behavior="@string/bottom_sheet_behavior">
<include layout="@layout/new_item_sheet" />
</android.support.v4.widget.NestedScrollView>
Alles anzeigen
XML: new_item_sheet.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageButton
android:id="@+id/btn_close_sheet"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:background="@drawable/down"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btn_close_sheet">
<Button
android:id="@+id/btn_insert"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:text="Einfügen"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_menge" />
<ImageButton
android:id="@+id/btn_choose_new_category"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="8dp"
android:background="@drawable/category"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="@+id/tv_kategorie"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/tv_kategorie" />
<ImageButton
android:id="@+id/btn_set_date"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="8dp"
android:background="@drawable/calendar"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="@+id/tv_getDatum"
app:layout_constraintEnd_toStartOf="@+id/btn_today"
app:layout_constraintTop_toTopOf="@+id/tv_getDatum" />
<EditText
android:id="@+id/tv_menge"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:ems="10"
android:hint="Menge"
android:inputType="textPersonName"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_ausgabe" />
<EditText
android:id="@+id/tv_getDatum"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:ems="10"
android:focusable="true"
android:hint="Datum"
android:inputType="none"
app:layout_constraintEnd_toStartOf="@+id/btn_set_date"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="@+id/tv_ausgabe"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:ems="10"
android:hint="Beschreibung"
android:inputType="textPersonName"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_kategorie" />
<EditText
android:id="@+id/tv_kategorie"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:ems="10"
android:hint="Kategorie"
android:inputType="textPersonName"
app:layout_constraintEnd_toStartOf="@+id/btn_choose_new_category"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_getDatum" />
<ImageButton
android:id="@+id/btn_today"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="8dp"
android:background="@drawable/calendartoday"
android:scaleType="centerCrop"
android:text="Heute"
app:layout_constraintBottom_toBottomOf="@+id/tv_getDatum"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/tv_getDatum" />
</android.support.constraint.ConstraintLayout>
</android.support.constraint.ConstraintLayout>
Alles anzeigen