三个属性都用来适应视图的水平或垂直大小,一个以视图的内容或尺寸为基础的布局比精确地指定视图范围更加方便。1)fill_parent设置一个构件的布局为fill_parent将强制性地使构件扩展,以填充布局单元内尽可能多的空间。这跟Windows控件的dockstyle属性大体一致。设置一个顶部布局或...
分类:
移动开发 时间:
2015-01-10 17:58:21
阅读次数:
147
就是将上面的自定义布局放到一个Dialog里面,布局xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="155dp"
android:backgro...
分类:
移动开发 时间:
2015-01-09 15:32:11
阅读次数:
386
布局文件:http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:l...
分类:
移动开发 时间:
2015-01-06 17:46:32
阅读次数:
179
组件继承关系图: 组件通用属性: ? ? 1)layout_width:组件的宽度,一般只有三个值wrap_content、fill_parent(老版本中使用)、match_parent,但他不是唯一控制宽度的元素 ? ? 2)layout_height:组件的高...
分类:
移动开发 时间:
2015-01-05 22:04:38
阅读次数:
359
扩展BaseAdapter可以对各列表项进行最大限度的定制,具体描述请看以下代码:
baseadapter_list布局文件:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout...
分类:
移动开发 时间:
2015-01-04 21:21:51
阅读次数:
240
现在侧滑菜单使用很多,大都是通过SlidingMenu实现。现在也可以通过DrawerLayout创建抽屉布局frament_content.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:...
分类:
移动开发 时间:
2015-01-03 19:55:18
阅读次数:
202
一、先送上效果图:
二、xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:...
分类:
移动开发 时间:
2014-12-31 18:27:44
阅读次数:
190
Android 如何使控件位于界面底部
使控件位于界面底部有很多种办法,下面我就分情况说一下:
一、LinearLayout布局中:
把握三个原则即可轻松使控件位于界面底部:
1、最外层父容器LinearLayout设置高度 layout_height="match_parent"
2、 内层LinearLay...
分类:
移动开发 时间:
2014-12-29 21:36:06
阅读次数:
187
1 2 6 12 13 18 19 listview的item,必须使用android:layout_width="match_parent" android:layout_height="match_parent"/>gravity才生效ImageButton...
分类:
其他好文 时间:
2014-12-25 20:26:49
阅读次数:
189
同一个布局文件,Android5.0以下的都可以显示
而Android5.0显示不了文字
布局文件:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android...
分类:
移动开发 时间:
2014-12-25 14:38:53
阅读次数:
182