Issue
I have an android layout which has a webView and a View inside it. i decide at Run time whether to display the webview or not and if not then the other View should fill the parent background. Also i would want the webView to appear at the bottom and for that i have set the layout_gravity to bottom but it doesn't work.
Here is what my xml looks like :
<?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:orientation="vertical"
android:weightSum="1" >
<WebView
android:id="@+id/webView1"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_gravity="bottom" />
<View
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</View>
</LinearLayout>
Solution
In terms of making the View disappear setting the visibility through something like
WebView myWebview = (WebView) findViewById(R.id.web_view_id);
myWebview.setVisibility(View.GONE);
Will do the trick. As for laying it out at the bottom of your view, LinearLayout lays out items in the order that they are given, so just move your LinearLayout below your other View and it should layout properly.
Answered By - Jonathan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.