【Android Training UI】创建自定义Views(Lesson 0 - 章节概览)

本文详细介绍了如何在Android中创建自定义视图,包括创建View类、自定义绘制、增加交互性和优化视图等步骤,确保视图既美观又高效。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

发表在我的独立网站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

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,谢谢配合!

 

转载于:https://www.cnblogs.com/snake-hand/p/3165588.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值