Android Chinese API (21) -- digitalclock

Source: Internet
Author: User

 

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"/>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.