一:界面设计
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_mar...
分类:
移动开发 时间:
2015-08-18 19:35:18
阅读次数:
201
使用RecyclerView 时,在xml文件中设置宽度match_parent无效,发现在Adapter中要如下填充view(注释掉的填充方式会导致match_parent无效) /**
* 创建新View,被LayoutManager所调用
*/
@Override
...
分类:
移动开发 时间:
2015-08-17 19:58:42
阅读次数:
357
在layout上显示文字时,因为字数过多不能全部显示,可以添加一个滚动条在layout中<TextViewandroid:id="@+id/tv"android:layout_width="match_parent"android:layout_height="match_parent"android:scrollbars="vertical"//加滚动条android:singleLine="false"android:text=..
分类:
移动开发 时间:
2015-08-16 23:31:03
阅读次数:
297
在控件的任意位置显示图片
效果图xml代码
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:l...
分类:
其他好文 时间:
2015-08-14 01:11:10
阅读次数:
154
ScrollView嵌套RecyclerView时,android:layout_height=”wrap_content”并不起作用,RecyclerView会填充剩余的整个屏幕空间,也就相当于android:layout_height=”match_parent”,通过重写GridLayoutManager或LinearLayoutManager 的onMeasure方法进行可重置Recycle...
分类:
其他好文 时间:
2015-08-13 15:56:16
阅读次数:
671
activity_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:lay...
分类:
其他好文 时间:
2015-08-13 12:18:59
阅读次数:
86
一:界面设计
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".Ma...
分类:
移动开发 时间:
2015-08-13 12:15:30
阅读次数:
173
效果图:
activity的布局xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
andro...
分类:
移动开发 时间:
2015-08-12 13:23:34
阅读次数:
162
源码里看下就知道了。。 -1不代表宽度,代表MATCH_PARENT常量的值public static final int FILL_PARENT = -1;public static final int MATCH_PARENT = -1;public static final int WRAP_...
分类:
其他好文 时间:
2015-08-11 13:36:16
阅读次数:
136
消息机制
main.xml文件代码。
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
androi...
分类:
其他好文 时间:
2015-08-10 22:14:40
阅读次数:
154