Android单机版音乐盒
Android单机版音乐盒
这个小软件主要用到了可以后台运行的Service组件、BroadcastReceiver组件、Intent、菜单对话框的使用及音乐的播放等。
布局很明了,通过三个线性布局的嵌套。
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:Android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="horizontal"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content">
- <ImageButton
- android:id="@+id/start"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/png2"/>
- <ImageButton
- android:id="@+id/stop"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/png1"/>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
- <TextView
- android:id="@+id/textView1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textSize="25px"
- android:textColor="#ffffff"
- android:ellipsize="marquee"//跑马灯效果
- android:layout_weight="1"
- android:marqueeRepeatLimit="marquee_forever"//跑马灯无限循环
- android:text="@string/myTextView1"/>
- <TextView
- android:id="@+id/textView2"
- android:textSize="15px"
- android:gravity="center_vertical"
- android:layout_weight="1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/myTextView2"/>
- </LinearLayout>
- </LinearLayout>
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/jinsha"
- />
- </LinearLayout>
|
评论暂时关闭