点击自定义对话框就闪退了
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | <? xml version = "1.0" encoding = "utf-8" ?> < LinearLayout xmlns:android = "http://schemas.android.com/apk/res/android" android:layout_width = "match_parent" android:layout_height = "wrap_content" android:orientation = "vertical" android:gravity = "center_horizontal" android:background = "@color/skyblue" > < TextView android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:text = "提示" android:textSize = "34sp" android:textColor = "#ffffff" android:textStyle = "bold" android:layout_marginTop = "30dp" /> < view android:layout_width = "fill_parent" android:layout_height = "2dp" android:background = "#ffffff" android:layout_marginTop = "10dp" android:layout_marginBottom = "10dp" /> < TextView android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:text = "您确定要退出当前程序吗" android:layout_marginTop = "10dp" android:textColor = "#ffffff" android:textSize = "20sp" /> < LinearLayout android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:orientation = "horizontal" android:layout_marginTop = "15dp" android:layout_marginBottom = "20dp" > < Button android:id = "@+id/btn_yes" android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:text = "否" android:background = "#ffffff" android:textColor = "@color/skyblue" /> < Button android:id = "@+id/btn_no" android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:text = "是" android:background = "#ffffff" android:textColor = "@color/skyblue" android:layout_marginLeft = "15dp" /> </ LinearLayout > </ LinearLayout > |
21
收起
正在回答 回答被采纳积分+1
5回答
慕UI1226118
2018-02-05 19:44:31
<view
android:layout_width="fill_parent"
android:layout_height="2dp"
android:background="#ffffff"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"/>
这一段代码删了,我和你情况一样。
Android零基础入门2018版
- 参与学习 人
- 提交作业 5461 份
- 解答问题 7235 个
此次推出的专题为Android攻城狮培养计划的第一部分语法与界面基础篇,将带大家从0开始学习Android开发。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧