#如圖怎麼設(shè)定這樣的效果,圖片在兩個佈局邊緣上這個activity下面有一個正在播放影片的activity,我用幀佈局已設(shè)定透明就全透明了。
不知道是不是這個效果
代碼:
<?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="match_parent"
android:background="@android:color/holo_green_dark"
android:clipChildren="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:background="@android:color/darker_gray">
<View
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="bottom"
android:src="@mipmap/ic_launcher"/>
<View
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
</LinearLayout>
</RelativeLayout>
關(guān)鍵在這句代碼:
android:clipChildren="false"
解釋:
是否限制子View在其範(fàn)圍內(nèi) 預(yù)設(shè)為true
使用錨點。範(fàn)例可以網(wǎng)路搜尋或是Studio中File-New-Activity-ScrollingActivity建立一個自備的預(yù)設(shè)模板,裡面版面就是