- 浏览: 376426 次
- 性别:
- 来自: 深圳
文章分类
- 全部博客 (269)
- FY_UML (3)
- FY_JAVA (12)
- FY_JavaScript脚本 (7)
- FY_JSP (3)
- FY_Tapestry框架 (12)
- FY_Spring框架 (3)
- FY_Manager (5)
- FY_Junit(单元测试) (3)
- SERVER (14)
- FY_Struts2框架 (3)
- FY_SVN (2)
- FY_NoSQL (2)
- FY_jquery_sir (13)
- FY_hibernate_sir (8)
- FY_设计模式_sir (6)
- FY_Extjs_sir (10)
- FY_CI_sir (5)
- FY_Oracle_sir (11)
- FY_MySql_sir (10)
- FY_Hadoop_sir (3)
- FY_SOA_sir (1)
- 中文分词技术 (1)
- FY_Android (52)
- FY_架构 (2)
- FY_PhoneGap (2)
- FY_Webstorm (5)
- FY_Sencha Touch (3)
- HTML5应用快速开发 (1)
- FY_python (0)
- HADOOP (1)
- AI (0)
最新评论
-
antao592:
楼主,HkDataSourceWrapper中的getCurr ...
结合spring jdbc 实现分表分库的数据库访问构思 -
bonait:
不错,看看我的这个怎么样www.zipin168.com
So Easy京东商城 -
chenzheng8975:
...
So Easy京东商城 -
yzhenxing:
我导入demo后少com.google.android.gms ...
google地图demo -
echoaiya:
非常感谢~~
google地图demo
--------------------------------------------strings.xml--------------------------------------------
<resources>
<string name="app_name">com.ch03</string>
<string name="hello_world">Hello world!</string>
<string name="menu_settings">Settings</string>
<string name="title_activity_main">com.ch03</string>
<string name="gender">性别</string>
<string name="female">女</string>
<string name="male">男</string>
<string name="lovely">爱好</string>
<string name="food">美食</string>
<string name="music">音乐</string>
<string name="btn">注册</string>
</resources>
--------------------------------------------activity_main.xml-------------------------------------
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/gender" />
<RadioGroup
android:id="@+id/general"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<RadioButton
android:id="@+id/male"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/male" />
<RadioButton
android:id="@+id/female"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/female" />
</RadioGroup>
<TextView
android:layout_width="fill_parent"
android:layout_height="1sp"
android:background="#000000" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/lovely" />
<CheckBox
android:id="@+id/food"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/food" />
<CheckBox
android:id="@+id/music"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/music" />
<Button
android:id="@+id/btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/btn" />
</LinearLayout>
--------------------------------------------MainActivity--------------------------------------------
package com.ch03;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.RadioGroup;
import android.widget.Toast;
/**
*
* 项目名称:com.ch03
* 类名称:MainActivity
* 类描述: 单选按钮与复选按钮
* 创建人:fy
* 创建时间:2012-11-2 下午10:35:02
* Copyright (c) 方勇-版权所有
*/
public class MainActivity extends Activity {
/* 单选按钮 */
private RadioGroup radiog_geneal;
/* 复选,美食 */
private CheckBox check_food;
/* 复选,音乐 */
private CheckBox check_music;
/* 注册按钮 */
private Button btn_register;
/* 性别 */
private String gender;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
findViews();
setListeners();
}
/* 初始化UI控件 */
private void findViews() {
radiog_geneal = (RadioGroup) findViewById(R.id.general);
check_food = (CheckBox) findViewById(R.id.food);
check_music = (CheckBox) findViewById(R.id.music);
btn_register = (Button) findViewById(R.id.btn);
}
/* 设置监听器 */
private void setListeners() {
btn_register.setOnClickListener(onClickListener);
radiog_geneal.setOnCheckedChangeListener(onCheckedChangeListener);
}
/* 显示结果 */
private void showResults(String values) {
Toast.makeText(MainActivity.this, values, Toast.LENGTH_LONG).show();
}
/* 双击事件 */
private OnClickListener onClickListener = new OnClickListener() {
@Override
public void onClick(View v) {
showResults("性别是:" + gender + "爱好是:" + check_food.getText().toString() + check_music.getText().toString());
}
};
/* 单选按钮选择事件 */
private RadioGroup.OnCheckedChangeListener onCheckedChangeListener = new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
if (checkedId == R.id.male) {
gender = "男";
showResults("您选择的是男");
} else {
gender = "女";
showResults("您选择的是女");
}
}
};
}
<!--EndFragment-->
发表评论
-
史上最快 Android N(安卓7.0)运行效率暴增至600%
2016-10-15 10:08 863谷歌I/O 2016开发者大会在公司总部正式拉开 ... -
So Easy京东商城
2014-12-10 16:51 1516So Easy京东商城 我和17位小伙伴们 ... -
过期Gallery取代方案horizontalscrollView之菜单导航效果
2014-03-23 16:19 2316效果 ------------------------- ... -
过期Gallery取代方案horizontalscrollView之京东效果
2014-03-23 15:57 3817效果 ------------------------- ... -
过期Gallery取代方案horizontalscrollView之幻灯片效果
2014-03-21 17:33 2579效果 ------------------------- ... -
tabhostandbadgeview
2014-03-19 13:45 988效果 -------------------------- ... -
Android优秀开源项目大全
2014-03-18 15:17 1930以下是开源项目 1、and ... -
Android分页控件xlistview
2014-03-18 14:51 1627strings.xml ----------------- ... -
过期Gallery取代方案horizontalscrollView之普通画廊
2014-03-17 22:48 2400activity_main.xml ---------- ... -
viewpage
2014-03-17 18:08 1028strings.xml ----------------- ... -
FragmentStatePagerAdapter分页
2014-03-17 17:27 760ViewPager ViewPager 如 ... -
FragmentPagerAdapter与FragmentStatePagerAdapter差异
2014-03-17 17:20 1279简介 平常使用的FragmentPagerAdapter和F ... -
抽屉菜单
2014-03-16 12:51 1790strings.xml ----------------- ... -
px和dip以及sp的区别
2014-03-08 17:01 672显示单位px和dip以及sp的区别 dip: devi ... -
fragment生命周期
2014-03-06 16:59 841Fragment必须被写成可重用的模块。因为fragmen ... -
过期API_AlertDialog
2014-03-02 10:07 1115layout----------------------- ... -
Android_Jni 操作指南
2014-01-10 14:45 910Android_Jni 操作指南 NDK(Nati ... -
各种各样圆形进度条
2013-11-11 16:30 525http://www.apkbus.com/android-1 ... -
红杏出墙__实训版
2013-04-20 18:59 1050红杏出墙__实训版 -
google地图demo
2013-04-09 14:25 3147---------------------------- ...
相关推荐
本demo实现功能为:Expandablelistview子项checkBox先获取已选择状态,在次过程中可修改子项选择,最终提交选择子类的项,并打印相关数据
利用Jquery实现的自定义美化radio与checkbox,好东西赶紧下的额。
jQuery美化radio和checkbox jQuery美化radio和checkbox jQuery美化radio和checkbox jQuery美化radio和checkbox
在Android中使用Radio和Checkbox的源码例子
10套美化的radio和checkbox组件。多重风格,多种特点。
自定义radio&checkbox;样式,不兼容IE8。利用css3选择器讲样式重构默认radio&checkbox;样式,可以自行优化样式代码。
每个样式对应的css,html,js 文件都有,享用直接套就可以
个人感觉比较好看的checkbox和radio的样式
android listview和checkbox联合使用,选中和取消
Android 带有切换动画的CheckBox
使用纯CSS代码实现radio以及checkbox的美化工作。附参考实例,可以根据具体情况进行进一步的修改,灵活多变。
简单实现自定义checkbox控件四种选择状态的图片样式
这个程序提供了两种实现透明的方法: 1,如果对话框背景色是纯色,那么直接返回NULL画刷即可。 2,如果背景是图片,那么在OnCtlColor中需要先绘制父窗口背景。
修改了checkbox事件处理,多选处理,适用于群发短信,电子邮件
android CheckBox的使用简单实例。
在ztree3.5 demo中加的页面demo\cn\super\radio_checkbox.html 页面上在组合功能演示--radio_checkbox共存中可以看到效果
Android 开灯 关灯 checkbox Radio组件用法演示,向大家展示了如何为CheckBox和RadioButton添加监听器及开关灯业务代码,通过单击不同的按钮,切换开灯图片和关灯图片,设置程序操作状态如下: public void ...
<item name="android:button">@drawable/selector</item>//这个selector.xml中就是对应不同状态的CheckBox的背景图片 3:在selector.xml <selector xmlns:android=...
radio/checkbox默认样式太丑?换个新鲜的样子吧!.zip,Radio and checkbox-style based on Javascript
CircleCheckBox Screenshot: Attrs attr format ...CircleCheckBox is available in the MavenCentral, so getting it as simple as adding it as a ...checkBox.setListener(new CircleCheckBox.On