Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android studio 在平板电脑上运行时,背景图像未占据整个屏幕_Android Studio_User Interface_Gridview_Layout_Scrollview - Fatal编程技术网

Android studio 在平板电脑上运行时,背景图像未占据整个屏幕

Android studio 在平板电脑上运行时,背景图像未占据整个屏幕,android-studio,user-interface,gridview,layout,scrollview,Android Studio,User Interface,Gridview,Layout,Scrollview,背景图像 android:background="@drawable/jhyti" 当应用程序安装在平板电脑上时,不会占用整个屏幕。 我使用的是滚动视图,布局参数为 <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:scaleType="centerCrop" android:background="@drawable

背景图像

android:background="@drawable/jhyti"
当应用程序安装在平板电脑上时,不会占用整个屏幕。 我使用的是滚动视图,布局参数为

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:scaleType="centerCrop"
    android:background="@drawable/jhyti"
    android:orientation="vertical">

<RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">


如何使背景图像占据整个屏幕?

更改xml文件中的scaletype以及相对布局中的宽度和高度

<LinearLayout
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:scaleType="fitXY"
   android:background="@drawable/jhyti"
   android:orientation="vertical">
 <RelativeLayout
  android:layout_width="match_parent"
  android:layout_height="match_parent">
 ImageView simpleImageView= 
(ImageView)findViewById(R.id.simpleImageView);
  simpleImageView.setScaleType(ImageView.ScaleType.FIT_XY);