Trouble positioning a seekbar below a webview
I am trying to put seekbar below Webview that shows Map.
However when i place the seekbar below WebView in main .xml, it doesn't come up. Can someone tell me what's wrong?
<?xml version="1.0" encoding="u开发者_C百科tf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webkit"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
<SeekBar
android:id="@+id/frequency_slider"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:max="1"
android:progress="0"
android:progressDrawable="@drawable/seekbar_progress"
android:paddingLeft="4dip"
android:paddingRight="4dip"
/>
</LinearLayout>
Your WebView has height set to "fill_parent" and thus it will take up the whole screen. So your seek bar is getting pushed off the bottom. You have a few options: set the height for your webview to something smaller than "fill_parent" (some static value in dip units, or wrap_content). Or use a RelativeLayout instead of linear and make use of the layout_alignParentBottom="true"
attribute for the seekbar. And layout_above="@+id/frequency_slider"
for the WebView. There are other ways you could solve the problem, but those are the easiest two that come to mind for me.
精彩评论