为View添加自定义XML属性Android中的各种Widget都提供了很多XML属性,我们可以利用这些XML属性在layout文件中为Widget的属性赋值。如下所示:<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:t...
分类:
移动开发 时间:
2016-03-02 01:51:17
阅读次数:
476
要弹出PopupWindow窗口的布局<?xmlversion="1.0"encoding="utf-8"?>
<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFBBFFBB"
android:..
使用style替换背景,防止Activity黑色背景闪过 1.原来的布局 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" andr
分类:
移动开发 时间:
2016-02-29 10:36:30
阅读次数:
238
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" an
分类:
其他好文 时间:
2016-02-28 16:40:59
阅读次数:
165
<LinearLayout android:id="@+id/recLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" androi
分类:
移动开发 时间:
2016-02-28 16:33:24
阅读次数:
377
昨天发现了一个RadioButton 的bug,出现bug的代码如下: 1 <RadioGroup 2 android:layout_width="wrap_content" 3 android:layout_height="wrap_content" 4 android:orientation="
分类:
其他好文 时间:
2016-02-28 15:06:12
阅读次数:
172
这次内容,我们就项目中添加商店名称的EditText进行修改,让添加按钮随着edittext的内容而改变。 上代码,首先是xml文件上对两个控件的修改: <RelativeLayout android:id="@+id/et_relative" android:layout_width="match
分类:
移动开发 时间:
2016-02-27 23:41:08
阅读次数:
349
1、xml对ImageView的src要设置成selector <ImageView android:id="@+id/like_icon" android:layout_width="@dimen/will_like_icon_width" android:layout_height="@dime
分类:
其他好文 时间:
2016-02-25 22:58:56
阅读次数:
292
第一步:为了更好的比较,准备两个一模一样的EditText(当Activity启动时,焦点会在第一个EditText上,如果你不希望这样只需要写一个高度和宽带为0的EditText即可避免,这里就不这么做了),代码如下:<EditText android:layout_width="fill_par
分类:
移动开发 时间:
2016-02-25 16:51:08
阅读次数:
191
目标:改变软键盘的外观使enter显示为“DONE”或“完成”,监听点击事件。 实现: 1.在xml文件中定义一个EditText <EditText android:layout_width="match_parent" android:layout_height="40dp" android:i
分类:
其他好文 时间:
2016-02-23 13:01:32
阅读次数:
123