1.使用FrameLayout布局可以在ImageView上放Button
2.使用Android:scaleType=“fitxy”设置图片填充
<FrameLayout //布局
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/button1"
android:layout_width="60dp"
android:layout_height="40dp"
android:layout_marginLeft="280dp"
android:layout_marginTop="20dp"
android:textColor="#ff0000"
android:onClick="splash"
android:text="跳过" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:scaleType="fitXY" //填充屏幕
app:srcCompat="@mipmap/img_splash1" />
</FrameLayout>
3:为Button设置透明度在(XXXActivity)你的方法
|