Android游戏开发系统控件-CheckBox(1)

创建项目“CheckBoxProject”

运行项目效果截图:

代码实现:

main.xml


<?xml version="1.0" encoding="utf-8"?>

 

<LinearLayout xmlns:android=http://schemas.android.com/apk/res/android

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:orientation="vertical" >

 

<TextView

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:text="@string/hello" />

 

<CheckBox

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:text="@string/cb1"

android:id="@+id/cb1"

/>

 

<CheckBox

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:text="@string/cb2"

android:id="@+id/cb2"

/>

 

<CheckBox

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:text="@string/cb3"

android:id="@+id/cb3"

/>

 

</LinearLayout>



string.xml


<?xml version="1.0" encoding="utf-8"?>

 

<resources>

<string name="hello">CheckBoxProject!</string>

<string name="app_name">CheckBox</string>

<string name="cb1">CheckBox1</string>

<string name="cb2">CheckBox2</string>

<string name="cb3">CheckBox3</string>

</resources>



CheckBoxProject.java


package com.checkBox;

 

 

import android.app.Activity;

import android.os.Bundle;

import android.widget.CheckBox;

import android.widget.CompoundButton;

import android.widget.CompoundButton.OnCheckedChangeListener;

import android.widget.Toast;

 

public class CheckBoxActivity extends Activity implements OnCheckedChangeListener{

private CheckBox cb1,cb2,cb3;//创建3个CheckBox对象

/** Called when the activity is first created. */

@Override

public void onCreate(Bundle savedInstanceState) {



### 文末

对于很多初中级Android工程师而言,想要提升技能,往往是自己摸索成长,不成体系的学习效果低效漫长且无助。 整理的这些架构技术希望对Android开发的朋友们有所参考以及少走弯路,本文的重点是你有没有收获与成长,其余的都不重要,希望读者们能谨记这一点。

最后想要拿高薪实现技术提升薪水得到质的飞跃。最快捷的方式,就是有人可以带着你一起分析,这样学习起来最为高效,所以为了大家能够顺利进阶中高级、架构师,我特地为大家准备了一套高手学习的源码和框架视频等精品Android架构师教程,保证你学了以后保证薪资上升一个台阶。

当你有了学习线路,学习哪些内容,也知道以后的路怎么走了,理论看多了总要实践的。

**进阶学习视频**

![](https://img-blog.csdnimg.cn/img_convert/06bfbefc9930c707f269db8fc0386c0c.webp?x-oss-process=image/format,png)

**附上:我们之前因为秋招收集的二十套一二线互联网公司Android面试真题** (含BAT、小米、华为、美团、滴滴)和我自己整理Android复习笔记(包含Android基础知识点、Android扩展知识点、Android源码解析、设计模式汇总、Gradle知识点、常见算法题汇总。)

![](https://img-blog.csdnimg.cn/img_convert/b15312c7e1b2956c3ffc316406e55740.webp?x-oss-process=image/format,png)




**网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。**

**[需要这份系统化学习资料的朋友,可以戳这里获取](https://bbs.csdn.net/topics/618156601)**

**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**

技术提升。**

**[需要这份系统化学习资料的朋友,可以戳这里获取](https://bbs.csdn.net/topics/618156601)**

**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值