android - How to set images on the edge of two layouts
淡淡烟草味
淡淡烟草味 2017-05-16 13:34:07
0
2
856

How to set up such an effect as shown in the figure. The picture is on the edge of the two layouts. There is an activity playing a video below this activity. I have used the frame layout to set the transparency and it is fully transparent.

淡淡烟草味
淡淡烟草味

reply all(2)
習慣沉默

I don’t know if this is the effect

Code:

<?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>

The key lies in this code:

android:clipChildren="false"

Explanation:

Whether to limit the sub-View within its scope. The default is true

PHPzhong

Use anchor points. For examples, you can search online or create a default template with File-New-Activity-ScrollingActivity in Studio. The layout inside is

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!