How to position WebView below TextView in layout and center horizontal ? Idea is at first row be button, textView, button and in second row webview.
<FrameLayout
android:id="@+id/linearLayout2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:layout_marginTop="40dp" >
<TextView
android:id="@+id/txtQuestion"
style="@style/question_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|center_horizontal"
android:layout_marginLeft="50dp"
android:layout_marginRight="55dp" />
<Button
android:id="@+id/btnPreviousQuestion"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|top"
android:layout_marginLeft="10dp"
android:background="@drawable/selector_arrow_left"
android:clickable="true" >
</Button>
<Button
android:id="@+id/btnNextQuestion"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|top"
android:layout_marginRight="10dp"
android:background="@drawable/selector_arrow_right"
android:clickable="true" >
</Button>
<WebView
android:id="@+id/wvMultimediaQuestion"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginLeft="50dp"
android:layout_marginRight="55dp"
android:visibility="gone" />
</FrameLayout>
You should use a RelativeLayout instead of a FrameLayout. Using a RelativeLayout you can define the position of views within the layout relatively to each other.
For example the attribute android:layout_toRightOf=”@id/txtQuestion” on the second button would assure that the second button is to the right of the text view. The RelativeLayout several of those attributes you can use to define your layout.