11 2011 档案
摘要:// 相对于给定ID控件android:layout_above 将该控件的底部置于给定ID的控件之上;android:layout_below 将该控件的底部置于给定ID的控件之下;android:layout_toLeftOf 将该控件的右边缘与给定ID的控件左边缘对齐;android:layout_toRightOf 将该控件的左边缘与给定ID的控件右边缘对齐;android:layout_alignBaseline 将该控件的baseline与给定ID的baseline对齐;android:layout_alignTop 将该控件的顶部边缘与给定ID的顶部边缘对齐;android:..
阅读全文
摘要:layout中设置图片自适应大小,并且设置最大宽高,当图片的宽高大于设置的最大值时,宽高值为设置的最大值。view plaincopy to clipboardprint?<ImageView Android:id="@+id/image_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:adjustViewBounds="true" android:maxWidth="42d
阅读全文
摘要:http://android.yaohuiji.com/archives/655
阅读全文
摘要:首先让我们理解下Android平台中的显示类是View,但是还提供了底层图形类android.graphics,今天所说的这些均为graphics底层图形接口。Bitmap-称作位图,一般位图的文件格式后缀为bmp,当然编码器也有很多如RGB565、RGB8888。作为一种逐像素的显示对象执行效率高,但是缺点也很明显存储效率低。我们理解为一种存储对象比较好。Drawable-作为Android平下通用的图形对象,它可以装载常用格式的图像,比如GIF、PNG、JPG,当然也支持BMP,当然还提供一些高级的可视化对象,比如渐变、图形等。Canvas-名为画布,我们可以看作是一种处理过程,使用各种方
阅读全文
摘要:importjava.io.FileNotFoundException;importjava.io.FileOutputStream;importjava.io.IOException;importandroid.app.Activity;importandroid.graphics.Bitmap;importandroid.graphics.Rect;importandroid.util.Log;importandroid.view.View;publicclassScreenShot{//获取指定Activity的截屏,保存到png文件privatestaticBitmaptakeScre
阅读全文
摘要:classMyThreadimplementsRunnable{publicvoidrun(){try{Thread.sleep(10000);}catch(InterruptedExceptione){//TODOAuto-generatedcatchblocke.printStackTrace();}Log.d("thread.......","mThread........");Messagemsg=newMessage();Bundleb=newBundle();//存放数据b.putString("color","
阅读全文
摘要:不多说,上源码就行publicclassRecentAdapterextendsBaseAdapter{privateclassRecentViewHolder{TextViewappName;ImageViewappIcon;TextViewappSize;}privateList<ResolveInfo>mAppList;privateLayoutInflatermInflater;privatePackageManagerpm;publicRecentAdapter(Contextc,List<ResolveInfo>appList,PackageManagerp
阅读全文
摘要:在硬编码中:ListViewlv=getListView();lv.setDivider(newColorDrawable(Color.GREEN));//用这个设置颜色lv.setDivider(getResources().getDrawable(android.R.drawable.ic_menu_camera));//或者选一个系统提供的样式lv.setDividerHeight(5);//设置高度XML中就好说了android:dividerHeight="3dip"android:divider="#FFCC00"举个栗子<ListVi
阅读全文

浙公网安备 33010602011771号