正文
一、結構
public class DigitalClock extends TextView
java.lang.Object
android.widget.DigitalClock
二、 概述
像AnalogClock( ),但是是數字的。顯示秒。修正:分開顯示小時/分鐘/秒,均衡的字型不能夠擺動顯示。(譯者注:根據字型按比例顯示小時/分鐘/秒,無法像AnalogClock轉動顯示)
三、 受保護方法
protected void onAttachedToWindow ()
視圖(DigitalClock)附在一個窗體上時調用。在這個點的表面進行繪制。注意這個方法保證在onDraw(Canvas)以前調用,但是它可以在第一次調用onDraw以前任何時間調用——包括onMeasure(int, int)之前或之後。
protected void onDetachedFromWindow ()
視圖(DigitalClock)從窗體上分離(移除)時調用。在這個點的表面不再有畫面繪制。
四、補充
4.2 使用代碼
<DigitalClock
android:id="@+id/DigitalClock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
本文轉自over140 51CTO部落格,原文連結:http://blog.51cto.com/over140/582669,如需轉載請自行聯系原作者