android知识点

如何实现两个页面的切换?
1、Activity的切换
2、通过改变加载控件的配置文件方式——setContentView(R.layout.main);
备注:创建这个加载的配置文件只能在layout目录下,要R这个文件能够识别出,否则这个工程是不能正常跑起来的
第二种方式相当于控件全部重新加载了一遍,因此之前绑定的事件也会随着控件的加载消失,因此这种方式只适合于显示切换,而切换的内容不应该有过多的操作。

 

常用控件的处理

<TableLayout
    	android:layout_width="fill_parent"
    	android:layout_height="wrap_content" 
    	android:collapseColumns="3"
    	android:stretchColumns="1">
	<TableRow>
		<TextView
			android:layout_width="wrap_content" 
			android:layout_height="wrap_content" 
			android:text="@string/sex"
		/>
		<RadioGroup 
			android:id="@+id/sex"
		>
			<RadioButton
				android:id="@+id/sex_boy"
				android:text="@string/boy"
				android:checked="true"
			/>
			<RadioButton
				android:id="@+id/sex_girl"
				android:layout_toRightOf="@id/sex_boy"
				android:text="@string/girl"
			/>
		</RadioGroup>
	</TableRow>
</TableLayout>
<CheckBox
	android:id="@+id/music"
	android:text="@string/music"
	android:layout_width="wrap_content" 
	android:layout_height="wrap_content" 
/>
<EditText
	android:id="@+id/username"
	android:layout_width="fill_parent" 
	android:layout_height="wrap_content" 
/>
<Spinner
	android:id="@+id/marray"
	android:layout_width="wrap_content" 
	android:layout_height="wrap_content" 
	android:layout_toRightOf="@id/label_marray"
	android:paddingLeft="15px"
	android:prompt="@string/marry"
/>

 备注:如果在控件配置文件中没有设定控件的高宽属性,则程序启动将会报错

Eclipse工具介绍——DDMS
1、File Explorer可以查看到SQLite创建的数据库文件
2、使用Log类(android.util.Log)可以自己打log,查看自己弄的

转载于:https://www.cnblogs.com/hbiao68/archive/2011/12/21/2296225.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值