面试时,一位面试官问到:“如果我想讲按钮居中显示,并且占据其父视图宽度的一半,应该怎么做到呢?”即实现这种效果:我们使用weightSum属性和layout_weight属性实现这一要求:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill...
分类:
移动开发 时间:
2015-06-14 09:36:59
阅读次数:
183
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_par...
分类:
移动开发 时间:
2015-06-12 19:32:52
阅读次数:
147
1.main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_hei...
分类:
移动开发 时间:
2015-06-12 17:33:50
阅读次数:
146
1.实现布局文件main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layo...
分类:
移动开发 时间:
2015-06-12 11:54:24
阅读次数:
221
第一步,先写布局文件
<com.main.util.SlideShowView
android:id="@+id/slideshowView"
android:layout_width="fill_parent"
android:layout_height="300dp"
...
分类:
移动开发 时间:
2015-06-11 14:41:43
阅读次数:
153
第一步,布局文件
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height=...
分类:
移动开发 时间:
2015-06-11 14:40:52
阅读次数:
163
第一步,布局文件
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@android:id/tabhost"...
分类:
移动开发 时间:
2015-06-11 14:39:00
阅读次数:
118
布局文件:只有一个ListView
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:lay...
分类:
移动开发 时间:
2015-06-10 22:41:22
阅读次数:
661
android:width 其实是定义控件上面的文本(TextView) 的宽度,当然这个宽度也是和 android:layout_width 配合起来作用的,如果 android:layout_width="fill_parent" 的话,那么设置 android:width 是没有意义的andr...
分类:
移动开发 时间:
2015-06-10 20:51:00
阅读次数:
130
源码地址 http://write.blog.csdn.net/postedit/46439929
先看主页面布局activity_main
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
and...
分类:
其他好文 时间:
2015-06-10 12:19:15
阅读次数:
107