【问题标题】:Kindle Fire Images not stretching to fill screenKindle Fire 图片未拉伸以填满屏幕
【发布时间】:2016-10-26 18:38:13
【问题描述】:

潜伏已久,第一次发帖!

我在我的 Kindle Fire 上遇到了一个问题,当我将图像(在本例中为页眉和页脚)插入相对布局并将宽度设置为“match_parent”或“fill_parent”时,出现白色两侧的边框。

但是,当我将图像放入线性布局并设置完全相同的参数时,它可以正常工作。

它在手机和我的三星平板电脑上完美运行,但我无法弄清楚 Fire 出了什么问题。

我希望这里有人能解决这个问题。我无法通过谷歌或 StackOverflow 搜索找到任何关于它的信息。

这是我的标题和相关布局的 XML 代码。

<RelativeLayout 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="*****************.MainActivity"
android:background="@drawable/background_xhdpi">

<ImageView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/imageHeader"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:src="@drawable/header_xhdpi"
    android:adjustViewBounds="true"/>

(问题示例)

感谢您的宝贵时间!

【问题讨论】:

  • 另外,如果有帮助的话,我正在使用 Android Studio。

标签: android android-layout kindle-fire


【解决方案1】:

对于遇到此问题的其他人,一位开发人员给了我解决方案。

将此添加到您的未正确拉伸的 ImageView 中:

android:adjustViewBounds="true"
android:scaleType="fitXY"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-31
    • 1970-01-01
    相关资源
    最近更新 更多