扫码关注官方订阅号
如图怎么设置这样的效果,图片在两个布局边缘上这个activity下面有一个正在播放视频的activity,我用帧布局已设置透明就全透明了。
不知道是不是这个效果
代码:
<?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>
关键在这句代码:
android:clipChildren="false"
解释:
是否限制子View在其范围内 默认为true
使用锚点。例子可以网上搜或者Studio中File-New-Activity-ScrollingActivity创建一个自带的默认模板,里面布局就是
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
不知道是不是这个效果

代码:
关键在这句代码:
解释:
使用锚点。例子可以网上搜或者Studio中File-New-Activity-ScrollingActivity创建一个自带的默认模板,里面布局就是