<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"tools:context=".MainActivity"><TextViewandroid:id="@+id/tv..
分类:
其他好文 时间:
2015-02-01 07:23:08
阅读次数:
239
1. 空layout
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical...
分类:
移动开发 时间:
2015-01-31 12:32:00
阅读次数:
172
安装了最新的ATD 18之后,新加的Lint Warnings插件会给我们检测出许多xml布局中不当的地方,例如:
Use a layout_height of 0dip instead of fill_parent for better performance
什么意思呢?举个简单的例子:
这是一个垂直布局,上下的线性布局各占高度50.0dp,中间的的TextView设...
分类:
其他好文 时间:
2015-01-28 13:09:50
阅读次数:
1974
主布局
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="ma...
分类:
移动开发 时间:
2015-01-27 23:32:26
阅读次数:
211
当我们自定义View的时候,在给View赋值一些长度宽度的时候,一般都是在layout布局文件中进行的。,比如android:layout_height="wrap_content",除此之外,我们也可以自己定义属性,这样在使用的时候我们就可以使用形如 myapp:myTextSize="20sp"...
分类:
移动开发 时间:
2015-01-27 00:08:58
阅读次数:
291
Main.xml程序如下:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertica...
分类:
移动开发 时间:
2015-01-26 22:56:41
阅读次数:
385
布局
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="3"
android:orientation="horizonta...
分类:
移动开发 时间:
2015-01-26 17:24:53
阅读次数:
165
线性布局中的layout_weight顾名思义即为定义各个组件在整个界面中所占的权重。常用两种实现方法
1:最为简单的实现方法,当orientation为水平时垂直layout_height=''0dp",同理当orientation为垂直时,将layout_width设定为0dp,此时在一个直接父布局中layout_width中的数值越大这个组件占的界面就越大。示例代码如下:
...
分类:
其他好文 时间:
2015-01-23 23:06:12
阅读次数:
136
首先在xml里面加一个Spinner控件<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="${packageName}...
分类:
移动开发 时间:
2015-01-21 20:33:45
阅读次数:
170
main.xml代码如下:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertica...
分类:
移动开发 时间:
2015-01-21 18:13:34
阅读次数:
134