0
我想知道如何使用sdk api 10
自定义主题/风格AlertDialog
。我知道该怎么做,从11日起但不知道如何做到这一点的10自定义alertdialog android api 10
XML版式文件
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
style="@style/dialog_theme" >
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/disclaimerText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/disclaimer"
android:padding="5dp"/>
<CheckBox
android:id="@+id/checkDisclaimer"
style="?android:attr/textAppearanceMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="@string/agree" />
</LinearLayout>
</ScrollView>
JAVA资源文件
AlertDialog.Builder builder = new AlertDialog.Builder(this);
//Setting Dialog Title
builder.setTitle("Disclaimer");
//Setting Dialog Message
builder.setMessage(R.string.disclaimer);
View view = (View) LayoutInflater.from(this).inflate(R.layout.layout_disclaimer, null);
builder.setView(view);
我已经创建了自定义布局,并添加到对话框中,但问题仍然不同,在我的布局中,我添加了style =“@ style/dialog_theme”但不行,我仍然可以看到系统的布局。我编辑了我的答案 – JAndroid