Почему между верхней частью текста и верхней частью изображения есть пространство ??
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_margin="9dp" android:background="#FFF"> <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margin="9dp"> <ImageView android:id="@+id/img_user" android:layout_width="30dp" android:layout_height="30dp" android:layout_marginRight="9dp" android:background="#000" /> <TextView android:id="@+id/username" android:layout_toRightOf="@id/img_user" android:layout_alignTop="@id/img_user" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#333" android:textStyle="bold" android:textSize="12dp" android:gravity="top" android:text="Username" /> <TextView android:id="@+id/timestamp" android:layout_toRightOf="@id/img_user" android:layout_alignBottom="@id/img_user" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#999" android:textSize="10dp" android:gravity="bottom" android:text="2h"/> </RelativeLayout>
Это неотъемлемая часть TextView. Попробуйте использовать поля и рассмотрите возможность размещения дополнительных макетов, чтобы освободить место для перемещения.
Вы установили поле поля в линейном макете, а затем снова в относительном макете.
android:layout_margin="9dp"