Как создать диалоговое окно пользовательского в андроиде, как это, Как создать пользовательское диалоговое окно с двумя кнопками в Android?
Я хочу так же, как это. Как сгенерировать его. пожалуйста, дайте мне предложение.
Я использовал ниже код для диалогового окна, в чем проблема в моем коде? Я не идентифицировал его. пожалуйста, поделитесь мной с идеей.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent">
<RelativeLayout
android:id="@+id/rl_quit_learning"
android:layout_width="match_parent"
android:layout_height="150dp"
android:background="@drawable/btn_white"
android:paddingBottom="@dimen/thirty_dp"
android:paddingLeft="@dimen/ten_dp"
android:paddingRight="@dimen/ten_dp"
android:paddingTop="@dimen/ten_dp">
<TextView
android:id="@+id/tv_quit_learning"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_margin="@dimen/ten_dp"
android:text="Quit LEarning?"
android:textSize="@dimen/twenty_sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_quit_learning"
android:layout_centerHorizontal="true"
android:layout_marginLeft="@dimen/ten_dp"
android:layout_marginRight="@dimen/ten_dp"
android:layout_marginTop="@dimen/twenty_dp"
android:gravity="center"
android:text="You are 400pts. away from \n unlocking rewards. Quit LEarning?"
android:textSize="@dimen/sixteen_sp" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="125dp"
android:gravity="center"
android:orientation="horizontal">
<Button
android:id="@+id/btn_cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cancel" />
<Button
android:id="@+id/btn_video"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Video" />
</LinearLayout>
</RelativeLayout>
Пожалуйста, поделитесь с нами идеей. Спасибо.
Вы можете получить ответ на свой вопрос здесь ... http://stackoverflow.com/questions/13341560/how -to-create-a-custom-dialog-box-in-android –
Просто создайте класс, который расширяет 'AlertDIalog.Builder' и раздувает ваш макет, а затем добавляйте его в класс' setVIew (yourView) ' –
Но Отмена и Кнопка видеоигры, которая отображает середину в основном макете. Пожалуйста, см. Изображение диалогового окна – Reena