iLMS知識社群歷程檔登入
位置: 網路程式設計 > 作業 > NetProg100_BN_課堂練習_MP3_Player_20120614
作業資訊  |  已交名單(26)
項目 內容
允許遲交
開放觀摩
屬性 個人作業
成績比重 未設定
期限
2012-06-14 23:59
附件
描述 as title.

James

// ------------ main.xml -----------
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/widget32"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/white" >

    <TextView
        android:id="@+id/tvStatus"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:text="Large Text"
        android:textAppearance="?android:attr/textAppearanceLarge" />

    <ImageButton
        android:id="@+id/ibtnStart"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/tvStatus"
        android:src="@drawable/play" />

    <ImageButton
        android:id="@+id/ibtnPause"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignTop="@+id/ibtnStart"
        android:layout_toRightOf="@+id/ibtnStart"
        android:src="@drawable/pause" />

    <ImageButton
        android:id="@+id/ibtnStop"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignTop="@+id/ibtnPause"
        android:layout_toRightOf="@+id/ibtnPause"
        android:src="@drawable/stop" />

    <ImageView
        android:id="@+id/imgDVD"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/ibtnStart"
        android:src="@drawable/white" />

</RelativeLayout>


// -- 圖片 --
        //
        Bitmap dvd = BitmapFactory.decodeResource( this.getResources(), R.drawable.dvd);
        imgDVD.setImageBitmap(dvd);

        // 若是 Canvas ==> cancas.drawBitmap(0,0, dvd);