The clock UI for Android development

Source: Internet
Author: User

Android has its own clock UI component, AnalogClock and DigitalClock, respectively, for analog and digital clocks.

1.AnalogClock

You can customize the dial, hour and minute hand. As follows, just set it in the XML file.

<!---        <analogclock            android:layout_width = "Wrap_content"             android:layout_height= "Wrap_content"            android:dial= "@drawable/ Watch "            android:hand_minute=" @drawable/hand "/>

The effect is as follows, where the dial and minute hand are the default images used by the hour hand, using their own defined pictures

2.DigitalClock

It is also very simple to use, defined directly in XML, with the following code:

< DigitalClock         Android:layout_width = "Wrap_content"         android:layout_height= "wrap_content"/>

The effect is as follows, which means that the display will change as the system settings change:

System uses 12-hour display time

System uses 24-hour display time

The clock UI for Android development

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.