Android 消除垂直线性布局中图像和文本之间的空白
我在垂直Android 消除垂直线性布局中图像和文本之间的空白,android,android-linearlayout,Android,Android Linearlayout,我在垂直线性布局中有一个图像视图和两个文本视图 <?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:paddingLeft=
线性布局中有一个图像视图
和两个文本视图
<?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:paddingLeft="16dp"
android:paddingRight="16dp"
android:orientation="vertical" >
<ImageView
android:id="@+id/logo"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center" />
<TextView
android:id="@+id/players"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="88dp"
android:maxLines="15"
android:text="TextView"
android:textStyle="bold" />
<TextView
android:id="@+id/subs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Subs" />
</LinearLayout>
我在图片和下面的文字之间有太多的空白。正在将图像的大小调整到ImageView
。我改变了背景颜色:图像看起来很好:占用了图像的预期空间,没有更多。从其他问题来看,我已经尝试了ImageView
的android:adjustViewBounds
属性,但这并没有什么不同 您看到空白的原因是players
TextView中的以下属性:
android:layout\u marginTop=“88dp”
根据您的需要删除它或减少空间。请显示屏幕截图。在文本视图中删除android:layout\u marginTop=“88dp”