下面先看看效果,這裏我直接截取了模擬器裏面的效果,嘻嘻,偷偷懶。android
上佈局代碼:web
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="240dp" android:paddingLeft="10dp" android:paddingRight="10dp" android:paddingTop="10dp"> <RelativeLayout android:layout_width="match_parent" android:layout_height="220dp" android:id="@+id/webMainLayout" > <ImageView android:id="@+id/iv_rankingvideo_img" android:layout_width="match_parent" android:layout_height="190dp" android:layout_weight="8" android:scaleType="centerCrop" android:src="@drawable/pic_video_img" /> <TextView android:id="@+id/tv_rankingvideo_title" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@+id/iv_rankingvideo_img" android:ellipsize="end" android:marqueeRepeatLimit="marquee_forever" android:paddingRight="2dp" android:text="這是個很長很長很長很長很長很長很長很長很長的標題" android:textColor="#2E363B" android:textSize="12sp" /> <Button android:id="@+id/btn_video_play" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:background="@drawable/pic_video_start" /> </RelativeLayout> </RelativeLayout>
這樣就Ok了,ide