以下の回答では適切な解決策が得られなかったため、必要なものをよりよく理解するために質問を編集しています。したがって、私がしなければならないことは、下部にニュートラル ボタンがあるカスタム アラート ダイアログを作成することです。これがどのように見えるべきかの例です:
これまで、xml を使用してアクティビティを に変更するカスタム ダイアログを使用していandroid:theme="@android:style/Theme.Holo.Light.Dialog"
たので、同じようなルック アンド フィールを得ることができます。ここに私のxmlコードがあります:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/dialog"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/login_prompt_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
android:text="@string/login_prompt_rewards_header"
android:textSize="17sp"
android:textStyle="bold" >
</TextView>
<TextView
android:id="@+id/login_prompt_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/login_prompt_header"
android:layout_marginTop="5dp"
android:gravity="center_vertical|center_horizontal"
android:paddingLeft="18dp"
android:paddingRight="18dp"
android:text="@string/login_prompt_rewards_text"
android:textSize="15sp" >
</TextView>
<Button
android:id="@+id/log_in"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/login_prompt_text"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_marginTop="15dp"
android:background="@drawable/log_in"
android:contentDescription="@string/none" >
</Button>
<Button
android:id="@+id/create_account"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/log_in"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:background="@drawable/create_account"
android:contentDescription="@string/none" >
</Button>
</RelativeLayout>
上記のレイアウトにより、次の結果が得られます。
私が直面している問題は次のとおりです:カスタムダイアログでニュートラルボタンを設定する方法は? 私はこれについて何の考えも得ていません。私の質問に疑問がある場合、または言語を理解できない場合は、コメントを残してください。もう一度明確なアイデアを提供できるようにします. 助けていただければ幸いです。