![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Android组件
rimuweinuan_
这个作者很懒,什么都没留下…
展开
-
AutoCompleteTextView
MainActivity.javapublic class MainActivity extends Activity { //字符串数组,可用数据库存储 private String[] str={"12隔壁一","12隔壁二","12隔壁三","12隔壁四","12隔壁五","12隔壁六"}; private AutoCompleteTextView actv; @Over原创 2016-01-19 21:25:39 · 232 阅读 · 0 评论 -
ProgressBar的使用
圆形:style="?android:attr/progressBarStyleLarge"效果:条形:style="?android:attr/progressBarStyleHorizontal"效果:xml<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"原创 2016-02-03 13:42:53 · 578 阅读 · 0 评论 -
SeekBar的使用
xml<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_horizontal"原创 2016-02-03 14:02:37 · 286 阅读 · 0 评论 -
自定义RatingBar
该自定义SeekBar,一次改变为一颗星1、在drawable插入两幅图,分别为start1:start2:2、在drawable创建一个xml,命名为myrating_bar.xml <item android:id="@+android:id/background" android:drawable="@drawable原创 2016-02-03 14:28:35 · 227 阅读 · 0 评论 -
对Spinner
xml<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_horizontal"原创 2016-02-03 15:50:32 · 195 阅读 · 0 评论 -
Listview的使用
下面展示Listview的两种不一样的方法,一种是自定义适配器,一种是系统自带的。xml布局1、整体friendlist.xml<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:la原创 2016-02-04 18:16:57 · 228 阅读 · 0 评论 -
Gallery的使用
xml布局1、整体activity_main.xml<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_pare原创 2016-02-04 20:46:07 · 511 阅读 · 0 评论 -
imageSwitcher的使用
xml布局1、整体activity_main.xml<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_pare原创 2016-02-04 21:12:24 · 237 阅读 · 0 评论 -
自定义组件
myzuhe.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="50dp" android:background="#ffc原创 2016-02-22 10:05:55 · 274 阅读 · 0 评论 -
group群组的使用
delete_button.xml<Button xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/friendlist_delete_item_delete" android:layout_width="wrap_content" android:layou原创 2016-02-22 10:47:28 · 494 阅读 · 0 评论 -
广播的使用
广播原创 2016-02-22 22:20:56 · 234 阅读 · 0 评论 -
AnalogClock、DigitalClock的xml布局
AnalogClock、DigitalClock的时间都是随着系统显示的。<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" an原创 2016-02-02 15:15:10 · 237 阅读 · 0 评论 -
TimerPicker的使用
xml<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" >原创 2016-02-02 14:05:26 · 663 阅读 · 0 评论 -
DatePicker使用
xml<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" >原创 2016-02-01 23:25:24 · 193 阅读 · 0 评论 -
HorizontalScrollView的使用
1、导入butterknife-7.0.1.jar包选择你的项目右键-->properties-->java compiler-->Annotation Processing-->勾选Enable annotation processing展开Annotation Processing-->Factory Path-->勾选Enable project specific set原创 2016-02-10 21:58:47 · 423 阅读 · 0 评论 -
fragment的使用
head.xml<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal原创 2016-02-11 17:41:24 · 229 阅读 · 0 评论 -
类似微信的界面
nothing.xml<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertica原创 2016-02-12 16:51:36 · 351 阅读 · 0 评论 -
ActionBar的使用
在Android3.0以上的版本使用在menu文件夹中的main.xml<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:holo="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/action原创 2016-02-12 20:47:18 · 225 阅读 · 0 评论 -
ActionBar和Fragment
nothing.xml<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertica原创 2016-02-13 01:05:31 · 380 阅读 · 0 评论 -
菜单
菜单分为硬件菜单和上下文菜单。1、新建工程,名为contextmenu,2、修改MainActivity.java为如下代码:package com.example.contextmenu;import android.app.Activity;import android.os.Bundle;import android.util.Log;import android.vi原创 2016-02-13 13:46:06 · 204 阅读 · 0 评论 -
Button的xml编写
<Button android:id="@+id/main_job_research" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1"原创 2016-02-01 15:33:45 · 652 阅读 · 0 评论 -
RadioButton的使用
xml布局<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" >原创 2016-02-01 16:37:41 · 255 阅读 · 0 评论 -
ToggleButton的使用
xml<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" >原创 2016-02-01 17:21:15 · 223 阅读 · 0 评论 -
CheckBox的使用
xml<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" >原创 2016-02-01 19:30:00 · 237 阅读 · 0 评论 -
多线程的关闭方式
设一个标识符,可以达到暂停的效果。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原创 2016-02-22 23:43:58 · 833 阅读 · 0 评论