我想知道如何配置背景图像,以便可以在整个屏幕上看到它,删除 ActionBar,我想让通知栏透明,以便在那里也可以看到图像。提前致谢。
曾治疗:
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/background"/>
我想知道如何配置背景图像,以便可以在整个屏幕上看到它,删除 ActionBar,我想让通知栏透明,以便在那里也可以看到图像。提前致谢。
曾治疗:
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/background"/>
几个选项,第一个是通过属性将图像定义为背景
android:background
第二个,通过一个
ImageView
带有属性的android:layout_width="match_parent"
和android:layout_height="match_parent"
,定义一个带有属性的图像android:background
:第三个通过 ImageView,使用属性
android:scaleType="fitXY"
:第四,定义主题,在其中定义图像:
并从您的活动中加载它,在
AndroidManifest.xml
对于背景图像,给 Layout 一个背景
android:background="@drawable/background_game_screen"
,例如:为了通知栏的透明度,请尝试将其放置在您的主题中:
如果你想删除 ActionBar 这样做:
或通过代码: