У меня есть ImageView
, который я установил в android:layout_alignParentRight="true"
, однако он не отображается в правой части экрана, и я не уверен, почему (это белый квадрат, горизонтально на скриншоте ниже).android: layout_alignParentRight = "true" ничего не делает
Я понимаю, что это можно использовать только с RelativeLayout
, но я использовал один - так что я точно не знаю, почему это происходит.
<?xml version="1.0" encoding="utf-8"?>
<com.example.project.DragLayer xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:id="@+id/drag_layer"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/black" >
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:weightSum="1.0" >
<GridView
android:id="@+id/image_grid_view"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="0.8"
android:background="@color/grid_background"
android:gravity="center"
android:horizontalSpacing="2dip"
android:numColumns="@integer/num_columns"
android:stretchMode="columnWidth"
android:verticalSpacing="2dip" />
<RelativeLayout
android:id="@+id/bottom_part"
android:layout_width="fill_parent"
android:layout_height="200dp"
android:layout_centerHorizontal="true"
android:layout_weight="0.2"
android:background="@android:color/black"
android:orientation="horizontal"
android:weightSum="1.0" >
<Button
android:id="@+id/button_add_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:onClick="onClickAddImage"
android:text="Add image" />
<com.example.project.DeleteZone
android:id="@+id/delete_zone_view"
android:layout_width="60dp"
android:layout_height="60dp"
android:src="@drawable/delete_zone" />
<FrameLayout
android:id="@+id/image_source_frame"
android:layout_width="fill_parent"
android:layout_height="80dp"
android:layout_weight="0.5" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentRight="true"
android:layout_gravity="right"
android:layout_marginRight="5dp"
android:layout_weight="1" >
<ImageView
android:id="@+id/sqwhite"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_alignParentRight="true"
android:layout_gravity="right"
android:layout_marginRight="5dp"
android:layout_weight="1" />
<EditText
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@id/sqwhite"
android:layout_marginRight="5dp" >
<requestFocus />
</EditText>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@id/editText1"
android:layout_marginRight="5dp"
android:text=""
android:textColor="@android:color/white" />
</RelativeLayout>
</FrameLayout>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</com.example.project.DragLayer>