我在编辑我的问题,以便更好地理解我需要的内容,因为下面的回答并未给出适当的解决方案。所以,我必须做的是在底部使用中性按钮进行自定义警报对话框。这里是例如,它应该是什么样子:Android:带有自定义对话框和中性按钮的警报对话框
直到现在我一直在使用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>
通过上述布局,我发现了以下结果:
我现在面临的问题是:如何设置中性按钮自定义对话?我对此没有任何想法。如果您对我的问题有疑问,或者您无法理解该语言,请发表评论,以便我再次给您一个清晰的想法。帮助将不胜感激。
你是如何能得到它绿色的按钮,使它看起来3D? – Si8 2013-08-15 13:57:41
@ SiKni8我为此使用了自定义drawable。 – Anupam 2013-08-15 18:31:23