android ui开发专题(一) 之界面设计

android ui开发专题(一) 之界面设计

ID:16309713

大小:50.00 KB

页数:6页

时间:2018-08-09

android ui开发专题(一) 之界面设计_第1页
android ui开发专题(一) 之界面设计_第2页
android ui开发专题(一) 之界面设计_第3页
android ui开发专题(一) 之界面设计_第4页
android ui开发专题(一) 之界面设计_第5页
资源描述:

《android ui开发专题(一) 之界面设计》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

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

2、类android.content.res.Resources可能很多网友比较陌生,一起来看看SDK上是怎么介绍的吧,Containsclassesforaccessingapplicationresources,suchasrawassetfiles,colors,drawables,mediaorotherotherfilesinthepackage,plusimportantdeviceconfigurationdetails(orientation,inputtypes,etc.)thata

3、ffecthowtheapplicationmaybehave.平时用到的二进制源文件raw、颜色colors、图形drawables和多媒体文件media的相关资源均通过该类来管理。  intgetColor(intid)对应res/values/colors.xml  DrawablegetDrawable(intid)对应res/drawable/  XmlResourceParsergetLayout(intid)对应res/layout/  StringgetString(intid)和

4、CharSequencegetText(intid)对应res/values/strings.xml  InputStreamopenRawResource(intid)对应res/raw/  voidparseBundleExtra(StringtagName,AttributeSetattrs,BundleoutBundle)对应res/xml/  String[]getStringArray(intid)res/values/arrays.xml  floatgetDimension(int

5、id)res/values/dimens.xml  二、android.graphics.Bitmap  作为位图操作类,Bitmap提供了很多实用的方法,常用的我们总结如下:  booleancompress(Bitmap.CompressFormatformat,intquality,OutputStreamstream)压缩一个Bitmap对象根据相关的编码、画质保存到一个OutputStream中。其中第一个压缩格式目前有JPG和PNG  voidcopyPixelsFromBuffer(

6、Buffersrc)从一个Buffer缓冲区复制位图像素  voidcopyPixelsToBuffer(Bufferdst)将当前位图像素内容复制到一个Buffer缓冲区  我们看到创建位图对象createBitmap包含了6种方法在目前的Android2.1SDK中,当然他们使用的是APILevel均为1,所以说从Android1.0SDK开始就支持了,所以大家可以放心使用。  staticBitmapcreateBitmap(Bitmapsrc)  staticBitmapcreateBit

7、map(int[]colors,intwidth,intheight,Bitmap.Configconfig)  staticBitmapcreateBitmap(int[]colors,intoffset,intstride,intwidth,intheight,Bitmap.Configconfig)  staticBitmapcreateBitmap(Bitmapsource,intx,inty,intwidth,intheight,Matrixm,booleanfilter)  stati

8、cBitmapcreateBitmap(intwidth,intheight,Bitmap.Configconfig)  staticBitmapcreateBitmap(Bitmapsource,intx,inty,intwidth,intheight)  staticBitmapcreateScaledBitmap(Bitmapsrc,intdstWidth,intdstHeight,booleanfilter)//创建一个可以缩放的位图对象  finalintgetHeigh

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

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

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