此次浅谈布局中权重,废话不多说,直奔主题。首先我们创建一个LineatLayout 布局,并设置为横向放置;布局中放置三个文本框tv1;tv2;tv31、当我们给三个 TextView的宽度都设置成Layout_width="fill_parent",设置三个文本框的权重分别是1:2:2;此时三个文...
分类:
移动开发 时间:
2015-09-11 12:36:38
阅读次数:
200
控件 控件 TextView? EditText Button ImageButton 属性 *id hint text src *layout_width inputType *layout_height ImageView text src="@drawable/ic_" textColor background=""图片/颜色 background singleL...
分类:
移动开发 时间:
2015-09-08 23:49:08
阅读次数:
353
一、自定义进度条 1.<ProgressBar
????????android:id="@+id/patch_progress"
????????style="@style/gxProgressStyle"
????????android:layout_width="match_parent"
????????a...
分类:
其他好文 时间:
2015-09-08 20:26:32
阅读次数:
246
代码实现后界面如图:一。xml文件1.<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"android:id="@+id/relativelayout"><TextVie..
分类:
其他好文 时间:
2015-09-03 11:39:51
阅读次数:
246
android:scaleType="center" android:src="@drawable/my_image" android:layout_width="50dp" android:layout_height="50dp" android:scaleType...
分类:
其他好文 时间:
2015-09-02 22:03:53
阅读次数:
328
Spinner:
是类似下拉列表的一种控件,用户从中选择相应选项!
Spinner中的数据需要使用Adapter(适配器)填充。
使用:
布局文件activity_main.xml:
<Spinner
android:id="@+id/spinner"
android:layout_width="match_parent"
...
分类:
移动开发 时间:
2015-09-01 09:16:12
阅读次数:
214
CheckBox复选框
1.属性:android:id="@+id/checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"//复选框状态
具体在mainActivity.java中实现
package com.imooc....
分类:
移动开发 时间:
2015-08-31 10:15:18
阅读次数:
196
代码地址下载
activity_main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
andro...
分类:
其他好文 时间:
2015-08-30 14:27:37
阅读次数:
203
1.AutoCompleteTextView属性:
1>动态匹配输入的内容
2>android:completionThreshold="n" -- 输入n个字符开始匹配
在activity_main.xml中加入AutoCompleteTextView:
代码如下:
<AutoCompleteTextView
android:layout_width...
分类:
移动开发 时间:
2015-08-30 13:00:29
阅读次数:
166
一般在外卖的选单中常常会用到ListView的多选,大家可以改进后加入自己的项目中。下面看一下代码:一、代码1.main.xml:(由一个ListView和一个Button组成)
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_paren...
分类:
移动开发 时间:
2015-08-29 18:52:13
阅读次数:
376