问题1. 运行Activity的时候出现Your content must have a TabHost whose id attribute is 'android.R.id.tabhost'添加Layout的时候,xml跟元素选择TabHost, 但是ADT没有添加id属性, 运行的时候,会提示... Read More
posted @ 2014-07-01 18:18 陈帆 Views(114) Comments(0) Diggs(0) Edit
让View的内容右对齐 textview1靠左,textview2靠右。 Read More
posted @ 2014-07-01 11:23 陈帆 Views(149) Comments(0) Diggs(0) Edit
android:screenOrientation="landscape"是限制此页面横屏显示,android:screenOrientation="portrait"是限制此页面数竖屏显示。"unspecified"- 默認值. 由系統選擇顯示方向. 在不同的設備可能會有所不同."landscap... Read More
posted @ 2014-07-01 10:57 陈帆 Views(306) Comments(0) Diggs(0) Edit
本质区别为:AlertDialog是非阻塞式对话框:AlertDialog弹出时,后台还可以做事情;而PopupWindow是阻塞式对话框:PopupWindow弹出时,程序会等待,在PopupWindow退出前,程序一直等待,只有当我们调用了dismiss方法的后,PopupWindow退出,程序... Read More
posted @ 2014-06-27 17:20 陈帆 Views(13435) Comments(3) Diggs(0) Edit
三个属性都用来适应视图的水平或垂直大小,一个以视图的内容或尺寸为基础的布局比精确地指定视图范围更加方便。1)fill_parent设置一个构件的布局为fill_parent将强制性地使构件扩展,以填充布局单元内尽可能多的空间。这跟Windows控件的dockstyle属性大体一致。设置一个顶部布局或... Read More
posted @ 2014-06-26 09:43 陈帆 Views(85) Comments(0) Diggs(0) Edit
Intent intent= new Intent(MainActivity.this,ToggleBtnActivity.class); startActivity(intent);其中 MainActivity为当前的Activity ToggleBtnActiv... Read More
posted @ 2014-06-25 18:19 陈帆 Views(174) Comments(0) Diggs(0) Edit
01. 01. 相对布局常用属性介绍 这里将这些属性分成组,便于理解和记忆。 a)、第一类:属性值为true或false android:layout_centerHrizontal 水平居中 android:layout_centerVertical 垂直居中 android:la... Read More
posted @ 2014-06-24 17:09 陈帆 Views(192) Comments(0) Diggs(0) Edit
Activity 的生命周期和 J2ME 的 MIDlet 一样,在 android 中,Activity 的生命周期交给系统统一管理。与 MIDlet 不同的是安装在 android 中的所有的 Activity 都是平等的。Activity 的状态及状态间的转换在 android 中,Activ... Read More
posted @ 2014-06-24 17:05 陈帆 Views(104) Comments(0) Diggs(0) Edit
1、首先第一步下载 JDK 因为系统是win7 64位 JDK下载地址为:http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-windows-x64.exe2、下载eclipse 下载地址为: http://dl.google.co... Read More
posted @ 2014-06-23 17:53 陈帆 Views(86) Comments(0) Diggs(0) Edit
c#同步时间第一种方法:借用系统接口[DllImport("user32.dll")] private static extern bool AnimateWindow(IntPtr hwnd, int dwTime, int dwFlags); [DllImport("Kernel32.dll")] private static extern Boolean SetSystemTime([In, Out] SystemTime st); [DllImport("Kernel32.dll")] public static extern Read More
posted @ 2013-09-30 15:54 陈帆 Views(546) Comments(0) Diggs(0) Edit