Parasol
1874 · 共 8 篇文章
Android利用canvas画各种图形(点、直线、弧、圆、椭圆、文字、矩形、多边形、曲线、圆角矩形)转
转自: http://blog.csdn.net/rhljiayou/article/details/7212620 1、首先说一下canvas类: Class Overview The Canvas class holds the "draw" calls. To draw something, you need 4 basic components: A Bitmap to hold the pixels, a Canvas to host the draw calls (writing into the bitmap), a drawing primitive (e.g. Rect, …
2013-08-19 23:47 · android · 评论(0)
android 图片的自由缩放和旋转
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <ImageView android:id="@+id/imageview" android:layout_width="200dp" android:layout_…
2013-08-19 21:35 · android · 评论(0)
Android Intent机制实例详解(Activity篇)转
Android Intent机制实例详解(Activity篇) http://www.uml.org.cn/mobiledev/201208211.asp Android 中提供了 Intent 机制来协助应用间的交互与通讯,或者采用更准确的说法 是, Intent 不仅可用于应用程序之间,也可用于应用程序内部的 Activity/Service 之间的交互。 Intent 这个英语单词的本意是“目的、意向”等,对于较少从事 于大型平台开发工作的程序员来说, 这可能 是一个不太容易理解的抽象概念,因为它与我们平常使用的简单函数/ 方法调用,或者上节中提到的通过库调用接口的方式不太一样。在 I…
2013-08-18 10:40 · android · 评论(0)
android RadioButton单选按钮的使用
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" a…
2013-08-15 11:08 · android · 评论(0)
android Bitmap位图的使用
使用BitmapFactory (Creates Bitmap objects from various sources, including files, streams, and byte-arrays.) 利用 BitmapFactory 可以从一个指定文件中,利用 decodeFile ()解出Bitmap;也可以定义的图片资源中,利用 decodeResource ()解出Bitmap。 使用BitmapFactory类decodeStream(InputStream is)解码位图资源,获取位图。 使用BitmapFactory类Bitmap bmp=BitmapFactory.…
2013-08-13 21:34 · android · 评论(0)
SpannableStringBuilder 和 SpannableString(转)
EditText: 通常用于显示文字,但有时候也需要在文字中夹杂一些图片,比如QQ中就可以使用表情图片,又比如需要的文字高亮显示等等,如何在android中也做到这样呢? 记得android中有个android.text包,这里提供了对文本的强大的处理功能。 添加图片主要用SpannableString和ImageSpan类: Java代码 Drawable drawable = getResources().getDrawable(id); drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsi…
2013-08-13 21:10 · android · 评论(0)
Android应用开发——TextView控件属性列表
android:autoLink设置是否当文本为URL链接/email/电话号码/map时,文本显示为可点击的链接。可选值(none/web/email/phone/map/all) android:autoText如果设置,将自动执行输入值的拼写纠正。此处无效果,在显示输入法并输入的时候起作用。 android:bufferType指定getText()方式取得的文本类别。选项editable 类似于StringBuilder可追加字符,也就是说getText后可调用append方法设置文本内容。spannable 则可在给定的字符区域使用样式,参见这里1、这里2。 android:cap…
2013-08-13 15:55 · android · 评论(0)
JAVA引用类型和原始类型区别
http://webservices.ctocio.com.cn/java/158/9361658.shtml Java 提供两种不同的类型:引用类型和原始类型(或内置类型)。另外,Java 还为每个原始类型提供了封装类(Wrapper)。如果需要一个整型变量,是使用基本的 int 型呢,还是使用 Integer 类的一个对象呢?如果需要声明一个布尔类型,是使用基本的 boolean,还是使用 Boolean 类的一个对象呢?本文可帮助您作出决定。 下表列出了原始类型以及它们的对象封装类。 原始类型 封装类 ================= boolean Boolean char Cha…
2013-07-31 21:01 · java · 评论(0)