2012年6月14日
摘要: 1 package xiacl.ui; 2 3 import android.app.Activity; 4 import android.os.Bundle; 5 6 import android.view.Menu; 7 import android.view.MenuItem; 8 import android.view.SubMenu; 9 import android.widget.Toast;10 11 public class MenuTest extends Activity {12 /** Called when the activity is first cr... 阅读全文
posted @ 2012-06-14 17:42 xiacl 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 关于listview和button都要改变android原来控件的背景,在网上查找了一些资料不是很全,所以现在总结一下android的selector的用法。首先android的selector是在drawable/xxx.xml中配置的。先看一下listview中的状态:把下面的XML文件保存成你自己命名的.xml文件(比如list_item_bg.xml),在系统使用时根据ListView中的列表项的状态来使用相应的背景图片。drawable/list_item_bg.xml<?xml version="1.0" encoding="utf-8" 阅读全文
posted @ 2012-06-14 16:02 xiacl 阅读(122) 评论(0) 推荐(0) 编辑
2012年6月10日
摘要: 效果图:main.xmlpackage xiacl.test;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.TextView;import android.graphics.Color;import android.graphics.Typeface;public class Test1Activity extends Activity { private TextView mTex. 阅读全文
posted @ 2012-06-10 20:04 xiacl 阅读(367) 评论(0) 推荐(0) 编辑
摘要: AlertDialog对话框效果图:Test1Activity.java 1 package xiacl.test; 2 3 import android.app.Activity; 4 import android.os.Bundle; 5 import android.view.View; 6 import android.widget.Button; 7 8 import android.app.AlertDialog; 9 import android.content.DialogInterface;10 11 public class Test1Activity extends .. 阅读全文
posted @ 2012-06-10 18:50 xiacl 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 实现标准体重计算器的功能效果图:main.xml 1 <?xml version="1.0" encoding="utf-8"?> 2 <AbsoluteLayout 3 android:id="@+id/widget0" 4 android:layout_width="fill_parent" 5 android:layout_height="fill_parent" 6 xmlns:android="http://schemas.android.com/apk/r 阅读全文
posted @ 2012-06-10 00:57 xiacl 阅读(268) 评论(0) 推荐(0) 编辑
2012年6月9日
摘要: 手机界面的切换_setContentView的应用res/layout/main.xml:<?xml version="1.0" encoding="utf-8"?><AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:back 阅读全文
posted @ 2012-06-09 20:09 xiacl 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 编写****Activity.java前不要忘记导入包。比如Button类,要引用 import android.widget.Button;输入数组TextView tv =(TextView)findViewById(R.id.TextView01); char char_1[]=new char[5]; char_1[0]='J'; char_1[1]='a'; char_1[2]='m'; char_1[3]='e'; char_1[4]='s'; tv.setText(char_1,1,3);//输出结果 阅读全文
posted @ 2012-06-09 17:01 xiacl 阅读(387) 评论(0) 推荐(0) 编辑
2012年5月10日
摘要: 10个经典的Android开源应用项目http://www.apkbus.com/android-13519-1-1.html安卓巴士总结了近百个Android优秀开源项目,覆盖Android开发的每个领域http://www.apkbus.com/android-17627-1-1.html一个demo让你掌握Android的各种Service:http://www.apkbus.com/android-19645-1-1.htmlandroid开发教程专题http://dev.apkbus.com/Android 动画效果专题研究:http://www.apkbus.com/android 阅读全文
posted @ 2012-05-10 21:03 xiacl 阅读(208) 评论(0) 推荐(0) 编辑
2012年5月9日
摘要: Ctrl+1 快速修复(最经典的快捷键,就不用多说了)Ctrl+D: 删除当前行 Ctrl+Alt+↓ 复制当前行到下一行(复制增加)Ctrl+Alt+↑ 复制当前行到上一行(复制增加)Alt+↓ 当前行和下面一行交互位置(特别实用,可以省去先剪切,再粘贴了)Alt+↑ 当前行和上面一行交互位置(同上)Alt+← 前一个编辑的页面Alt+→ 下一个编辑的页面(当然是针对上面那条来说了)Alt+Enter 显示当前选择资源(工程,or 文件 or文件)的属性Shift+Enter 在当前行的下一行插入空行(这时鼠标可以在当前行的任一位置,不一定是最后)Shift+Ctrl+Enter 在当前行插 阅读全文
posted @ 2012-05-09 22:13 xiacl 阅读(163) 评论(0) 推荐(0) 编辑
摘要: RelativeLayout用到的一些重要的属性:第一类:属性值为true或falseandroid:layout_centerHrizontal 水平居中android:layout_centerVertical 垂直居中android:layout_centerInparent 相对于父元素完全居中android:layout_alignParentBottom 贴紧父元素的下边缘android:layout_alignParentLeft 贴紧父元素的左边缘... 阅读全文
posted @ 2012-05-09 21:37 xiacl 阅读(165) 评论(0) 推荐(0) 编辑