发表在我的独立网站http://kesenhoo.github.io/blog/2013/06/30/android-training-ui-creating-custom-views-lesson-0/,欢迎访问!


Android的framework有大量的Views用来与用户进行交互并显示不同种类的数据。但是有时候你的程序有个特殊的需求,而Android内置的views组件并不能实现。这一章节会演示如何创建你自己的views,并使得它们是robust与reusable的。

Dependencies and Prerequisites

Android 2.1 (API level 7) or higher

YOU should also read

  • Custom Components
  • Input Events
  • Property Animation
  • Hardware Acceleration
  • Accessibilitydeveloper guide

Try it out

Download the sample
CustomView.zip

Lesson

(1)创建一个View类

Create a class that acts like a built-in view, with custom attributes and support from the ADT layout editor.

(2)自定义Drawing

Make your view visually distinctive using the Android graphics system.

(3)使得View是可交互的

Users expect a view to react smoothly and naturally to input gestures. This lesson discusses how to use gesture detection, physics, and animation to give your user interface a professional feel.

(4)优化View

No matter how beautiful your UI is, users won’t love it if it doesn’t run at a consistently high frame rate. Learn how to avoid common performance problems, and how to use hardware acceleration to make your custom drawings run faster.

学习自:http://developer.android.com/training/custom-views/index.html,请多指教,谢谢!
转载请注明出自http://kesenhoo.github.com,谢谢配合!

更多相关文章

  1. android 自定义 dialog
  2. android 自定义 dialog
  3. [Android]在Android(安卓)google Map中標出自己的位置
  4. android ndk 安装
  5. android ndk 纵览
  6. Android(安卓)Permission大全
  7. This Android(安卓)SDK requires Android(安卓)Developer Toolki
  8. 【Android随记】-- Android动态加载布局
  9. Android入门学习四:Android系统框架

随机推荐

  1. 利用Unity脚本自定义分辨率实现相机截一
  2. 【C++】深入了解继承方式基础知识及其与
  3. C#/基于Unity 行为树的实现步骤【纯代码
  4. Unity实现脚本插件[Script Create Dialog
  5. 深入理解C#设计模式之策略模式 角色具体
  6. 设计一个c++ 通用链表:实现多态双向的功能
  7. 采用 C# 编写的学委助手详解及实例
  8. C++实现贪吃蛇游戏的详细步骤及实战演示
  9. Thinking in C++ 第一卷阅读全书笔记重点
  10. C/C++区别有哪些?很多人都不知道的比较方