看完http://blog.csdn.net/woshishuoshuoa/article/details/9840857后,TabHost的基本界面已出来了,从这一节开始着手解决上节提出的四个界面,首先是Music部分,下面就先给出item_music.xml布局的代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<ImageView
android:id="@+id/img_music"
android:layout_width="65dp"
android:layout_height="65dp"
android:layout_margin="5dp"
android:src="@drawable/music"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="65dp"
android:layout_margin="5dp"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="190dp"
android:layout_height="65dp"
android:orientation="vertical"
android:layout_weight="0" >
<TextView
android:id="@+id/title_music"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="25sp"
android:gravity="center"
android:text="一世美好"
/>
<TextView
android:id="@+id/singer_music"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="20sp"
android:gravity="right"
android:text="张韶涵"/>
</LinearLayout>
<TextView
android:id="@+id/time_music"
android:layout_width="20dp"
android:layout_height="65dp"
android:layout_margin="5dp"
android:layout_weight="1"
android:text="02:00"
android:gravity="center"
android:textSize="20sp"/>
</LinearLayout>
</LinearLayout>
效果图:
这篇仅仅给出了一个xml布局,java代码部分还没做好,不过小菜鸟在下次博文里会给出java代码的哦~~~在设计这个界面时,还是比较耗点时间的,主要烦在LinearLayout中又嵌套了LinearLayout,有点绕,不过慢慢理一理就好了呢,之后还有比这个更烦的布局,就是播放界面的布局,比较绕的,嵌套比较多。。。。欢迎喜欢安卓的亲们给出宝贵的意见哈~~~小菜鸟建议喜欢安卓的亲们,亲自动手慢慢做一做这样的界面,不要直接参考或拷贝哦~~~