I want to have three images in one row, and a Video or two below them. So far, I am unable to correctly position the three images via Relative Layout.
It gets quite different behaviour from what I expect it to be... it shows only one picture, as though it is a FrameLayout.I can开发者_JAVA百科 assure you the images are in place. And the java code is nothing but straightforward OnCreate - super.OnCreate, setContentView(R.layout.component_name) . What is wrong with this relative layout?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/previous_frame"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/previous_frame" />
<ImageView
android:id="@+id/catch_frame"
android:layout_toLeftOf="@+id/previous_frame"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/catch_frame"
/>
<ImageView
android:id="@+id/next_frame"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/next_frame"
android:layout_toLeftOf="@id/catch_frame"
/>
</RelativeLayout>
Check the code use android:toRightOf instead of android:toLeftOf..
精彩评论