Android(安卓)让TextView变成Dialog
16lz
2021-12-04
<activity android:name=".CustomDialogActivity" android:theme="@style/Theme.CustomDialog" />
Theme.CustomDialog
<style name="Theme.CustomDialog" parent="android:style/Theme.Dialog"> <item name="android:windowBackground">@drawable/filled_box</item> </style>
filled_box.xml
<shape xmlns:android="http://schemas.android.com/apk/res/android"><!-- <solid android:color="#f0600000" /> --><gradient android:startColor="#000" android:endColor="#fff" /><stroke android:width="20dp" color="#ffff8080" android:dashWidth="5dp"android:dashGap="3dp" /><corners android:radius="10dp" /><padding android:left="20dp" android:top="50dp" android:right="20dp"android:bottom="50dp" /></shape>
----------------------------------快乐分割线----------------------------------
还可以让TextView变成提示框
requestWindowFeature(Window.FEATURE_LEFT_ICON); getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,android.R.drawable.ic_dialog_alert);
<TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/text" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_vertical|center_horizontal" android:text="注意"/>
更多相关文章
- [android] EditText的setError文字不显示问题
- 设置提示信息,输入值类型,输入框引入图片,设置输入框的形状
- android实现卸载提示
- Android(安卓)Studio中Can't resolve symbol. Validates resourc
- Android消息提示框Toast
- day01:Android快速入门
- Android仿百度谷歌自动提示——AutoCompleteTextView
- 《Android面试宝典》学习笔记(第四章:对话框、信息提示和菜单)
- Android找不到Manifest系统文件