[![enter] image description [1]] [1]我是android到android开发的新品牌,只是用xml来构建布局。我写了下面的代码来打印hello ubuntu并在其中插入图像。但该图像似乎有一个不需要的上下填充或边距(不知道它叫什么),看起来更奇怪。请任何人帮我删除它。这里是我的代码:ImageView中的不需要的填充或边距
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:background="@color/colorAccent"
android:orientation="vertical"
android:padding="10dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
android:layout_margin="8dp"
android:text="Hello Ubuntu (16.06LTS)"
android:background="@color/colorPrimary"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="0dp"
android:src="@mipmap/Ubuntu"
android:layout_margin="0dp"
/>
</LinearLayout>
截图这里(见右侧preiew):https://i.stack.imgur.com/j9NlT.png
检查你的Ubuntu命名图像。它是否有额外的空间? – Piyush
你能为它如何实际上看起来添加图像和如何你想它是 –
PLZ提供屏幕图像 –