- 博客(5)
- 收藏
- 关注
转载 android.util.AndroidRuntimeException: requestFeature() must be called before adding content
AndroidRuntime(419): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dream/com.dream.activity.YunXingChengXuActivity}: android.util.AndroidRuntimeException: requestFeature() mus
2015-05-18 17:21:59 353
转载 解决Your content must have a ListView whose id attribute is 'android.R.id.list'
1.错误提示:Your content must have a ListView whose id attribute is 'android.R.id.list' 对于以上错误,其实可能是因为我们要实现对ListView中setOnItemClick的事件监听而去继承了LiseActivity,但是却没有ListView的标签,只要在布局文件中添加定制Layout的代码,即将Li
2015-05-18 17:16:31 520
转载 android dialog提示框
对话框在应用程序中不是很必要的,不过好的对话框会给应用添加不少色彩,采用对话框可以增加应用的友好性。在这里我主要是通过几个Button呈现几个不同的对话框。Dialog类是所有对话框的基类,而他的生命周期是通过Activity来维护的。 首先只是显示一个确认按钮的简单对话框,代码如下: Button dialog1 = (Button) findViewById(R.id.dialog1)
2015-05-18 11:18:43 285
转载 Android单个控件占父控件宽度一半且水平居中
前些天,在工作中遇到了一个需求:一个“加载上一页”的按钮宽度为父控件宽度一半,且水平居中于父控件中。在此给出两种思路:1.直接在Activity代码中获取到当前父控件的宽度,并将此按钮宽度值设置成父控件宽度的一半。2.通过借用LinearLayout的 weightSum 和 weight_layout 属性达到效果。具体代码如下: android
2015-05-13 09:47:11 1219
转载 Mark一下 Nested weights are bad for performance
警告信息“Nested weights are bad for performance”的消除方法 原因分析:在布局进行嵌套使用时,父布局与子布局都使用了android:layout_weight,但不是必须使用时,便会出现如题所示的警告信息。 解决方法:根据实际情况,去除子布局中非必须使用的android:layout_weight。
2015-05-13 09:43:58 531
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人