Android UI开发

Android UI开发

ID:44702551

大小:28.91 KB

页数:14页

时间:2019-10-25

Android UI开发_第1页
Android UI开发_第2页
Android UI开发_第3页
Android UI开发_第4页
Android UI开发_第5页
资源描述:

《Android UI开发》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、AndroidUI开发专题(一)之界面设计近期很多网友对Android用户界面的设计表示很感兴趣,对于AndroidUI开发自绘控件和游戏制作而言掌握好绘图基础是必不可少的。本次专题分10节来讲述,有关OpenGLES相关的可能将放到以后再透露。本次主要涉及以下四个包的相关内容:  android.content.res资源类  android.graphics底层图形类  android.view显示类  android.widget控件类  一、android.content.res.Resources  对于Android平台的资源类android.content

2、.res.Resources可能很多网友比较陌生,一起来看看SDK上是怎么介绍的吧,Containsclassesforaccessingapplicationresources,suchasrawassetfiles,colors,drawables,mediaorotherotherfilesinthepackage,plusimportantdeviceconfigurationdetails(orientation,inputtypes,etc.)thataffecthowtheapplicationmaybehave.平时用到的二进制源文件raw、颜色colo

3、rs、图形drawables和多媒体文件media的相关资源均通过该类来管理。  intgetColor(intid)对应res/values/colors.xml  DrawablegetDrawable(intid)对应res/drawable/  XmlResourceParsergetLayout(intid)对应res/layout/  StringgetString(intid)和CharSequencegetText(intid)对应res/values/strings.xml  InputStreamopenRawResource(intid)对应res

4、/raw/  voidparseBundleExtra(StringtagName,AttributeSetattrs,BundleoutBundle)对应res/xml/  String[]getStringArray(intid)res/values/arrays.xml  floatgetDimension(intid)res/values/dimens.xml  二、android.graphics.Bitmap  作为位图操作类,Bitmap提供了很多实用的方法,常用的我们总结如下:  booleancompress(Bitmap.CompressFormat

5、format,intquality,OutputStreamstream)压缩一个Bitmap对象根据相关的编码、画质保存到一个OutputStream中。其中第一个压缩格式目前有JPG和PNG  voidcopyPixelsFromBuffer(Buffersrc)从一个Buffer缓冲区复制位图像素  voidcopyPixelsToBuffer(Bufferdst)将当前位图像素内容复制到一个Buffer缓冲区  我们看到创建位图对象createBitmap包含了6种方法在目前的Android2.1SDK中,当然他们使用的是APILevel均为1,所以说从Andr

6、oid1.0SDK开始就支持了,所以大家可以放心使用。  staticBitmapcreateBitmap(Bitmapsrc)  staticBitmapcreateBitmap(int[]colors,intwidth,intheight,Bitmap.Configconfig)  staticBitmapcreateBitmap(int[]colors,intoffset,intstride,intwidth,intheight,Bitmap.Configconfig)  staticBitmapcreateBitmap(Bitmapsource,intx,int

7、y,intwidth,intheight,Matrixm,booleanfilter)  staticBitmapcreateBitmap(intwidth,intheight,Bitmap.Configconfig)  staticBitmapcreateBitmap(Bitmapsource,intx,inty,intwidth,intheight)  staticBitmapcreateScaledBitmap(Bitmapsrc,intdstWidth,intdstHeight,booleanfilter)//创建一个可以缩放的位

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。