Preface
This chapter translates Android. widget. digitalclock into Android 2.2 R1. More friends are welcome to join the Chinese translation operation of Android Api! My mailbox over140@gmail.com.
Statement
You are welcome to repost, but please keep the original source of the article :)
Blog Garden: http://www.cnblogs.com/
Android Chinese translation group: http://www.cnblogs.com/over140/
Body
I. Structure
Public class digitalclock extends textview
Java. Lang. Object
Android. View. View
Android. widget. textview
Android. widget. digitalclock
Ii. Overview
Like analogclock (), but it is a number. Display seconds. Fixed: hours, minutes, And seconds are displayed separately. Even fonts cannot be displayed. (Translator's note: The font is displayed in a proportional manner by hour, minute, or second, and cannot be displayed like analogclock)
Iii. Protected Methods
Protected void onattachedtowindow ()
It is called when a view (digitalclock) is attached to a form. Draw the surface at this point. Note that this method must be called before ondraw (canvas), but it can be called any time before the first ondraw call-including onmeasure (INT, INT.
Protected void ondetachedfromwindow ()
Called when a view (digitalclock) is detached (removed) from a form. There is no image painting on the surface of this point.
Iv. Supplement
4.1 [android1.5] digitalclock custom date output format
4.2 Use Code
<Digitalclock
Android: Id = "@ + ID/digitalclock"
Android: layout_width = "wrap_content"
Android: layout_height = "wrap_content"/>