使用FragmentTabhost+Fragment实现一个底部导航栏
主布局: //放置Fragment
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_weight="1"...
分类:
其他好文 时间:
2016-05-07 07:58:07
阅读次数:
139
传统方法是继承现有View再重写方法,这种方式缺点很多: 1.往往不能在xml编辑器中预览效果; 2.比较难实现预期效果,比如设置宽度为wrap_content,实际显示为match_parent等; 3.需要在xml代码中声明自定义View的全路径,经常无法自动补全,需要手动复制粘贴路径; 4.一 ...
分类:
微信 时间:
2016-05-03 12:45:45
阅读次数:
334
样式效果
1、创建底部的布局 layout_footer.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
...
分类:
移动开发 时间:
2016-04-29 17:23:11
阅读次数:
231
1、android:layout_height属性: 必须将ListView的布局高度属性设置为非“wrap_content”(可以是“match_parent / fill_parent / 400dp等绝对数值”),如果ListView的布局高度为“wrap_content”,那么getView ...
分类:
其他好文 时间:
2016-04-28 21:21:12
阅读次数:
208
样式效果
1、创建底部的布局 layout_footer.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
...
分类:
移动开发 时间:
2016-04-26 20:02:15
阅读次数:
217
LinearLayout 1.核心属性 高度:layout_height (基于内容 wrap_content;基于父控件;) 宽度:layout_width 方向:orientation (纵向 vertical;横向 horizontal;) 位置:layout_gravity (居中 cent ...
分类:
移动开发 时间:
2016-04-18 17:00:18
阅读次数:
247
CheckBox两种状态:选中(true)和未选中(false)属性:android:id="@+id/checkbox"android:checked="false"是否选中的状态android:text="女"新建:<CheckBox
android:id="@+id/cb1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:te..
分类:
移动开发 时间:
2016-04-17 01:02:32
阅读次数:
177
1 xml文件 XML文件: <com.example.textviewdemo.MarqueeText //调用自定义控件,在xml文件里面加包名。类名android:id="@+id/tv1"android:layout_width="wrap_content"android:layout_he ...
分类:
其他好文 时间:
2016-04-11 13:51:51
阅读次数:
122
首先自定义MyText 注意在layout中使用的使用要添加包名 ? android:layout_width="match_parent" android:layout_height="wrap_content"> 首先自定义MyText 注意在layout中使用的使用要添加包名 ? androi ...
分类:
其他好文 时间:
2016-03-27 15:35:25
阅读次数:
155
TextView设置文字大小及颜色: 1.1)通过xml配置 <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:textColor="#FF0000" android: ...
分类:
其他好文 时间:
2016-03-24 16:14:15
阅读次数:
149