首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >试图显示图像视图,使其占用整个屏幕。

试图显示图像视图,使其占用整个屏幕。
EN

Stack Overflow用户
提问于 2014-03-13 19:02:12
回答 1查看 38关注 0票数 0

我得到的图像填补了大部分屏幕,但出于某种原因,它没有覆盖1/2英寸的空白在底部。我玩过填充物底部,但这没有帮助。

代码语言:javascript
运行
复制
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<ImageView
    android:id="@+id/welcome"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_margin="0dp"
    android:adjustViewBounds="true"
    android:paddingLeft="-130dp"
    android:paddingRight="-330dp"
    android:scaleType="fitXY"
    android:scrollX="150dp"
    android:scrollY="50dp"
    android:src="@drawable/jobs" />

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-03-13 19:07:26

使用“android:后台”而不是"android:src“

代码语言:javascript
运行
复制
 <LinearLayout 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"
    android:background="@color/Peru"
    android:gravity="center"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="@drawable/traffic2" />

</LinearLayout>
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22388435

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档