I’m working on relative layout. Basically i would like to put my ticker(lnrTicker) and the footer(txtFooter) at the bottom of the screen. Everything works file, except the ticker clips off some bottom portion of wvRight element. So i figured out that probably i’ll have to put android:layout_above=”@id/lnrTicker”, in the wvRight component. But whenever i do that, i see compilation error stating that cannot find resource “lnrTicker”. How can i achieve the layout, or is there something i’m missing in understanding to layout_above. Here is my layout file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relMain"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="0dp"
android:background="@color/black">
<WebView
android:id="@+id/wvHeader"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:visibility="gone"
android:scrollbars="none"/>
<WebView
android:id="@+id/wvLeft"
android:layout_width="300dp"
android:layout_height="fill_parent"
android:scrollbars="none"
android:visibility="gone"
android:layout_below="@id/wvHeader"/>
<WebView
android:id="@+id/wvRight"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:scrollbars="none"
android:layout_toRightOf="@id/wvLeft"
android:layout_below="@id/wvHeader"
android:layout_above="@id/lnrTicker"/>
<LinearLayout
android:id="@+id/lnrTicker"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="60dp"
android:layout_below="@id/wvRight"/>
<TextView
android:id="@+id/txtFooter"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="8sp"
android:layout_below="@id/lnrTicker"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
Is it possible to add android:layout_above=”@id/lnrTicker”, at runtime to wvRight component?
Yes.
<WebView android:layout_above="@+id/lnrTicker"then later
<LinearLayout android:id="@id/lnrTicker"The difference is that you’re declaring the android:id for the first time in
@id/wvRightand thus will need the+.