Я показываю диалог, когда пользователь нажимает кнопку. Когда появится диалоговое окно, и вы нажмете EditText, чтобы ввести какой-либо текст, вы больше не увидите нижние кнопки (и самый нижний EditText). Таким образом, вы должны нажать клавиатуру вниз, а затем выбрать кнопку или EditText. Я искал ответ некоторое время, но я не могу его найти.
Итак: как мне сделать мой диалог прокручиваемым? Видимо, мой код не помогает:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:orientation="vertical"
android:scrollbars="vertical"
android:scrollbarAlwaysDrawVerticalTrack="true">
<EditText
android:id="@+id/addKlantNaam"
android:textSize="20sp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/klantNaam"
/>
<EditText
android:id="@+id/addKlantLocatie"
android:textSize="20sp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/klantLocatie"
/>
<TextView
android:id="@+id/scheidenDoorKomma"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="16sp"
android:text="@string/scheidenDoorKomma"/>
<EditText
android:id="@+id/addFabrieken"
android:textSize="20sp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/fabrieken"
/>
<EditText
android:id="@+id/addMachines"
android:textSize="20sp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/machines"
/>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom" >
<Button
android:id="@+id/dialogAnnuleren"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/annuleren"
android:textSize="22sp" />
<Button
android:id="@+id/dialogToevoegen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/dialogAnnuleren"
android:textSize="22sp"
android:text="@string/toevoegen"/>
</RelativeLayout>
</LinearLayout>
This is how i call for the dialog:
btnAdd.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// custom dialog
dialog = new Dialog(context);
dialog.setContentView(R.layout.addklant_layout);
dialog.setTitle("Klant toevoegen");
Button BTNannuleren = (Button) dialog.findViewById(R.id.dialogAnnuleren);
// if button is clicked, close the custom dialog
BTNannuleren.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
Button BTNtoevoegen = (Button) dialog.findViewById(R.id.dialogToevoegen);
// if button is clicked, close the custom dialog
BTNtoevoegen.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
StoreKlantInDatabase task = new StoreKlantInDatabase();
task.execute(urlInsertKlant);
dialog.dismiss();
}
});
dialog.show();
}
});
кто-нибудь может помочь мне здесь?