Home>

Clock controls include analogclock and digitalclock, which are both responsible for displaying the clock,The difference is that the analogclock control displays the analog clock,And only the hour and minute hands,While digitalclock shows digital clock,Accurate to the second

Following usage of analog clock

Directory Structure:

Layout file

<?xml version="1.0" encoding="utf-8"?>
<!-The two clock controls, analogclock and digitalclock, do not require java code.
Just insert the following code in the layout's xml to display the time automatically->
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent">
  <!-Analog Clock Control->
  <analogclock android:id="@ + id/analogclock"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_horizontal" />
  <!-Digital Clock Control->
  <digitalclock android:id="@ + id/digitalclock"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_horizontal" />
</linearlayout>

operation result:

  • Previous C # rounded form simple implementation method
  • Next In-depth analysis of character arrays and methods of handling strings in C ++