一、细说layout_weight 目前最为推荐的Android多屏幕自适应解决方案。 该属性的作用是决定控件在其父布局中的显示权重,一般用于线性布局中。其值越小,则对应的layout_width或layout_height的优先级就越高,一般横向布局中,决定的是layout_width的优先级.....
分类:
移动开发 时间:
2015-01-14 14:13:57
阅读次数:
192
大家inflate应该用的比较多吧,尤其在使用listview 的时候。
先来看看item的布局文件
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="20...
分类:
其他好文 时间:
2015-01-10 01:28:38
阅读次数:
229
通常的在一个项目中会有顶部标题栏 和 底部导航栏。而且这些东西在很多个界面都有使用。
我们采用include 来进行布局的重用。
include标签常用于将布局中的公共部分提取出来供其他layout共用,以实现布局模块化。
标签可以使用单独的layout属性,前提是必须给其设置 android:layout_width 和 android:layout_height 两个属性。否则没效果...
分类:
移动开发 时间:
2015-01-09 19:27:45
阅读次数:
213
就是将上面的自定义布局放到一个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
LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
ListView android:id="@+id/android:list"
android:la...
分类:
移动开发 时间:
2015-01-09 14:20:11
阅读次数:
226
组件继承关系图: 组件通用属性: ? ? 1)layout_width:组件的宽度,一般只有三个值wrap_content、fill_parent(老版本中使用)、match_parent,但他不是唯一控制宽度的元素 ? ? 2)layout_height:组件的高...
分类:
移动开发 时间:
2015-01-05 22:04:38
阅读次数:
359
在登录或者注册的时候,有些软件中,需求要求密码可以查看和隐藏,其实实现起来也很简单。
首先定义布局:
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="50.0dip"
android:layout_marginLeft="15dip"...
分类:
移动开发 时间:
2015-01-05 18:45:26
阅读次数:
211
Android 如何使控件位于界面底部
使控件位于界面底部有很多种办法,下面我就分情况说一下:
一、LinearLayout布局中:
把握三个原则即可轻松使控件位于界面底部:
1、最外层父容器LinearLayout设置高度 layout_height="match_parent"
2、 内层LinearLay...
分类:
移动开发 时间:
2014-12-29 21:36:06
阅读次数:
187
项目实战:实现一个简单计算器界面设计(1)拖进一个大文本,整屏,设计各个数字及运算,用Table来存放。<TableLayoutandroid:layout_width="fill_parent"android:layout_height="wrap_content"><TableRowandroid:id="@+id/tableRow1"android:layout_width="fill_pare..
分类:
移动开发 时间:
2014-12-29 18:38:00
阅读次数:
280
我们在ListView的Adapter的getView方法里面经常会调用两个参数的inflate方法, mInflater.inflate(R.layout.adv_viewpager, null);我们可能会发现layout外层的layout_width layout_height属性都没起作用,...
分类:
移动开发 时间:
2014-12-26 20:05:29
阅读次数:
167