【发布时间】:2013-02-07 01:44:55
【问题描述】:
我正在构建一个自定义 DialogFragment。对话框布局设置为my_dialog.xml,但是如何修改对话框周围的颜色(透明灰色)?
my_dialog.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" >
<TextView
android:id="@+id/hello"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="@android:color/holo_orange_light"
android:gravity="center"
android:text="hello" />
</RelativeLayout>
MyDialogFragment.java
public class MyDialogFragment extends DialogFragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.my_dialog, container);
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
return view;
}
}
【问题讨论】:
标签: android background android-dialogfragment android-styles