Java 图像未在framelayout中正确显示
我正在framelayout下使用imageview。我在图像视图中应用了背景图像,但图像无法完全覆盖屏幕。它出现在中间。我想完全覆盖屏幕 我怎样才能做到呢? Thanx提前:-)Java 图像未在framelayout中正确显示,java,android,android-layout,imageview,android-tablelayout,Java,Android,Android Layout,Imageview,Android Tablelayout,我正在framelayout下使用imageview。我在图像视图中应用了背景图像,但图像无法完全覆盖屏幕。它出现在中间。我想完全覆盖屏幕 我怎样才能做到呢? Thanx提前:-) xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_he
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.muhammad.maqalatlayout.jild_copy"
android:background="@color/Green">
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@mipmap/brown_border1"
android:layout_margin="0dp"
android:layout_marginLeft="0dp"
android:layout_marginTop="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="0dp"
android:layout_gravity="top|left|bottom|center_vertical|right"
android:visibility="visible"
android:adjustViewBounds="false"
android:scaleType="fitStart"/>
xmlns:android=”http://schemas.android.com/apk/res/android"
xmlns:tools=”http://schemas.android.com/tools"
android:layout\u width=“匹配父项”
android:layout\u height=“match\u parent”
工具:context=“com.example.muhammad.maqalatlayout.jild\u copy”
android:background=“@color/Green”>
使用
android:scaleType="fitXY" and `match_parent` instead of `fill_parent`.
使用
我相信您的秤不起作用,因为您正在设置
android:background
属性。试试这个:
<ImageView
...
android:src="@mipmap/brown_border1"
... />
另外,最好将您的图像放在
/drawable/
文件夹中。我认为您的缩放不起作用,因为您正在设置android:background
属性。试试这个:
<ImageView
...
android:src="@mipmap/brown_border1"
... />
另外,最好将图像放在
/drawable/
文件夹中。您是否尝试过scaleType=“fitXY”
?是!我试过这个,但它不会影响布局!那么我猜,你的图像有一个超出边界的透明区域。你需要摆脱它。我尝试了这个图像,它也给了我同样的输出。我正确裁剪了没有透明边框的图像。您是否尝试过scaleType=“fitXY”
?是!我试过这个,但它不会影响布局!那么我猜,你的图像有一个超出边界的透明区域。你需要摆脱它。我尝试了这个图像,它也给了我同样的输出。我正确裁剪了没有透明边框的图像。使用此选项后,输出中不会出现任何更改!android:adjustViewBounds=“true”并将图像设置为android:src=“@mipmap/brown_border1”,使用此选项后,输出中不会出现任何更改!android:adjustViewBounds=“true”并将图像设置为android:src=“@mipmap/brown_border1”无效
@Muhammadwajih你能把你的项目上传到谷歌硬盘上吗?我可以试试吗?package com.example.muhammad.maqalatlayout;导入android.support.v7.app.AppActivity;导入android.os.Bundle;公共类jild_copy扩展了appcompativeactivity{@Override protected void onCreate(Bundle savedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_jild_copy)}
@muhammadwawajih listen,不要在这里复制,而是制作项目的zip文件并上传到谷歌硬盘上。[这是我的项目!没有效果!
@Muhammadwajih你能把你的项目上传到谷歌硬盘上吗?我可以试试吗?包com.example.muhammad.maqalatlayout;导入android.support.v7.app.appcompativity;导入android.os.Bundle;公共类jild\u copy扩展appcompativity{@Override protected void onCreate(Bundle savedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_jild_copy)}}
@Muhammadwajih听着,不要在这里复制,而是制作一个项目的zip文件并上传到谷歌硬盘上。[这是我的项目!