【发布时间】:2013-09-27 20:25:44
【问题描述】:
我查找了类似的问题,但他们的解决方案不起作用。我的相对布局正在添加左填充。
这是我的 XML:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:fillViewport="true"
android:padding="0dp" >
<ImageView
android:id="@+id/imageViewUserProfile"
android:layout_width="114dp"
android:layout_height="98dp"
android:layout_alignParentTop="false"
android:layout_margin="0dp"
android:adjustViewBounds="true"
android:padding="0dp"
android:src="@drawable/default_t" />
<TextView
android:id="@+id/textViewUserProfileName"
android:layout_width="fill_parent"
android:layout_height="44dp"
android:layout_alignParentTop="true"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/imageViewUserProfile"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/textViewUserProfileHighlights"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:layout_toRightOf="@id/imageViewUserProfile"
android:layout_below="@id/textViewUserProfileName"/>
</RelativeLayout>
</LinearLayout>
我删除了父级 LinearLayout 以仔细检查左侧填充是否至少来自 RelativeLayout 块。我已经尝试了大多数对其他人有用的方法。任何帮助或建议将不胜感激。
【问题讨论】:
-
可以加图片吗?
-
我试过,但我没有足够的图像声誉=(基本上,当我从 Eclipse android xml 编辑器上的图形布局中选择相对布局时,它会选择父级的整个宽度(线性布局),但它为左填充增加了一些 dp,因此我的图像应该在左上角,但左边有一点空间
-
你能给我发一张图片 RSenApps@gmail.com 吗?
-
已发送电子邮件,如果需要更多信息,我可以发送更大的照片。感谢您的宝贵时间
标签: android android-relativelayout padding