全。这是我的布局代码:
<?xml version="1.0" encoding="utf-8"?>
<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"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="@mipmap/backgroung"
tools:context=".MainScreen">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30pt"
android:text="@string/level1"
android:onClick="@string/level1"
android:id="@+id/level1"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="60pt"
android:text="@string/level2"
android:id="@+id/level2"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="90pt"
android:text="@string/level3"
android:id="@+id/level3"/>它看起来像是:

我想让打孔机的照片在整个白色背景上展开。
感谢你的帮助!
发布于 2016-08-09 17:03:58
我明白了,当添加新的图像资源时,它会调整图像的大小并裁剪成白色边框。需要硬拷贝-将整个照片粘贴到可绘制文件夹。
发布于 2016-08-09 13:49:22
最好在这里使用9patch镜像。其中打孔面积可以是恒定的,并且图像可以随着蓝色区域而伸展。这样你就不会面临图像因拉伸而变得模糊的问题。你可以找到一些很好的例子,教你如何在youtube上创建9补丁。这是一个sample。
发布于 2016-08-09 14:13:23
在你的RelativeLayout中,你看到那些android:paddingTop和下/左/右了吗?删除所有这些或更改为="0dp"。
将您的图像移动到<ImageView/>中按钮之前。
并使用android:scaleType="fitXY"
哦,确保你的图片没有任何空白边框。
https://stackoverflow.com/questions/38842873
复制相似问题