Hello Mark, Yes i've tried to use scrollview after many unsucessful attempt to post my issue on the android group.
On your advice i switched code to <LinearLayout xmlns:android="http://schemas.android.com/apk/res/ android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <WebView android:id="@+id/webview" android:layout_width="fill_parent" android:layout_height="0px" layout_weight="1" /> <Button android:id="@+id/backButton" android:text="@string/ close_button" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_centerHorizontal="true" /> </LinearLayout> But the webview still overrides all the screen space ;( Did i miss something ? or how i should write it to work with relativelayout please. Thank you Croco On Jan 10, 1:49 pm, Mark Murphy <[email protected]> wrote: > croco wrote: > > Hi all, > > > I'm trying without success to shape a simple screen composed of a > > webview and a closebutton on the bottom. > > When i run it i see the button close at bottom but when the loadURL of > > the webview is done the webview takes all the screen size and hide the > > close button ;( > > > FYI i load the url after i'm sure the view is displayed. > > > Do you have idea how to fix this? > > > Regards. > > > Croco > > > <LinearLayout xmlns:android="http://schemas.android.com/apk/res/ > > android" > > android:layout_width="fill_parent" > > android:layout_height="fill_parent" > > android:orientation="vertical"> > > <ScrollView android:layout_width="wrap_content" > > android:layout_height="wrap_content" android:layout_weight="1"> > > <WebView android:id="@+id/webview" > > android:layout_width="fill_parent" > > android:layout_height="wrap_content" /> > > </ScrollView> > > <Button android:id="@+id/backButton" android:text="@string/ > > close_button" > > android:layout_width="fill_parent" > > android:layout_height="wrap_content" > > android:layout_centerHorizontal="true" /> > > </LinearLayout> > > Issue #1: Don't wrap a WebView in a ScrollView. WebView handles > scrolling itself. > > Issue #2: android:layout_height="wrap_content" probably will not work > for WebView (and never works for ScrollView, in case you use a > ScrollView anywhere else). A height of wrap_content really only works > for fairly simple widgets, like buttons and EditText and such. > > Get rid of the ScrollView, put your layout_weight on the WebView, and > have WebView use android:layout_height="0px". Or, switch to RelativeLayout. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > Android Consulting/App Development:http://commonsware.com/consulting
-- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

