开发者

In my WebView ScrollView doesn't work properly, how can I Solve this?

Actually I have one xml file which have many view like textview, button, and webview in a top level I take one scroll view and then Parent Linear layout in between there is other view, also webview is there, but I can't scroll over WebView. Here is my xml file.Please help me.

and 'ö' this character not displayed in webview Code:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:background ="@drawable/main_bg"
  android:layout_height="wrap_content"
  android:orientation ="vertical">
    <LinearLayout
        android:layout_width ="fill_parent"
        android:layout_height ="wrap_content"
        android:background ="@drawable/global_logo">
    </LinearLayout>
    <ScrollView
        android:layout_width = "fill_parent"
        android:layout_height = "fill_parent"
        android:layout_weight = "1">
            <LinearLayout
                android:layout_width ="fill_parent"
                android:layout_height ="wrap_content"
                android:layout_weight = "1"
                android:orientation ="vertical">
                <TextView
                    android:id ="@+id/txtJobTitle"
                    android:layout_width ="wrap_content"
                    android:layout_height ="wrap_content"
                    android:text = "DHL Systems"
                    style = "@style/txtcolor"/>
                <TextView 
                    android:id="@+id/txtCompanyName"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:text="Company Name"
                    android:textColor="#000"
                    />
                <TextView
                    android:id ="@+id/txtPosition"
                    android:layout_width ="fill_parent"
                    android:layout_height ="wrap_content"
                    android:textColor="#000"
                    android:text = "PHP, WebTechnology" 
                    />
                <LinearLayout 
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">
                    <TextView
                        android:id = "@+id/txtPlace"
                        android:layout_width = "fill_parent"
                        android:layout_height = "wrap_content"
                        android:textColor="#000"
                        android:layout_weight="1"
                        android:text = "Place"
                        android:textStyle = "bold"/>
                    <TextView 
                        android:id="@+id/txtDate"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:textColor="#000"
                        android:layout_weight="1"
                        android:gravity="right"
                        android:text="11-Aug-2011"/>
                &l开发者_StackOverflow中文版t;/LinearLayout>
                <LinearLayout 
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:padding="8dip">
                    <ScrollView 
                        android:layout_width="fill_parent"
                        android:layout_height="125dip"
                        android:scrollbars="vertical|horizontal"
                        android:overScrollMode="ifContentScrolls">
                    <LinearLayout 
                        android:layout_width="fill_parent"
                        android:layout_height="125dip">
                        <WebView
                            android:id ="@+id/wvSmallDisc"
                            android:layout_width ="fill_parent"
                            android:layout_height ="125dip"
                            android:text = "11 Aug 2011"
                            android:scrollbars="horizontal|vertical"
                            />
                    </LinearLayout>
                </ScrollView>
                </LinearLayout>
                <View
                    android:layout_width ="wrap_content"
                    android:layout_height ="15dip"/>
                <LinearLayout 
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">
                    <TextView
                        android:layout_width ="wrap_content"
                        android:layout_height ="wrap_content"
                        android:text = "Kontakt"
                        android:layout_marginLeft="15dip"
                        style = "@style/txtcolor"/>
                    <TextView
                        android:layout_width = "fill_parent"
                        android:layout_height ="wrap_content"
                        android:text = "Global Personal Partner"
                        android:textColor = "#000"
                        android:textSize = "18dip"
                        android:layout_marginLeft="15dip"
                        style ="@style/txtcolor"/>
                    <ImageView 
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:src="@drawable/under"/>
                        <LinearLayout 
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:orientation="horizontal"
                            android:padding="4dip">
                            <TextView 
                                android:layout_width="fill_parent"
                                android:layout_height="wrap_content"
                                android:layout_weight="2"
                                android:textSize = "18dip"
                                android:layout_marginLeft="14dip"
                                android:text="Telefon :"
                                android:textColor="#000"/>
                            <TextView
                                android:id ="@+id/txtTelefone"
                                android:layout_width = "fill_parent"
                                android:layout_height ="wrap_content"
                                android:layout_weight="1"
                                android:text = "056 406 43 44 "
                                android:textColor = "#000"
                                android:textSize = "18dip"/>        
                    </LinearLayout>
                        <ImageView 
                                android:layout_width="fill_parent"
                                android:layout_height="wrap_content"
                                android:src="@drawable/under"/>
                            <LinearLayout 
                                android:layout_width="fill_parent"
                                android:layout_height="wrap_content"
                                android:orientation="horizontal"
                                android:padding="4dip"
                                >
                                <TextView 
                                    android:layout_width="fill_parent"
                                    android:layout_height="wrap_content"
                                    android:layout_weight="2"
                                    android:layout_marginLeft="14dip"
                                    android:textSize = "18dip"
                                    android:text="Fax :"
                                    android:textColor="#000"/>
                                <TextView
                                    android:id = "@+id/txtFax"
                                    android:layout_width = "fill_parent"
                                    android:layout_height ="wrap_content"
                                    android:layout_weight="1"
                                    android:text = "056 406 43 49"
                                    android:textColor = "#000"
                                    android:textSize = "18dip"/>        
                        </LinearLayout>
                        <ImageView 
                            android:layout_width="fill_parent"
                            android:layout_height="wrap_content"
                            android:src="@drawable/under"/>
            <LinearLayout 
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:padding="2dip">
                    <TextView 
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="14dip"
                        android:layout_weight="2"
                        android:textSize = "18dip"
                        android:text="E-Mail :"
                        android:textColor="#000"/>
                    <TextView
                        android:id = "@+id/txtemail"
                        android:layout_width = "fill_parent"
                        android:layout_height ="wrap_content"
                        android:layout_weight="1"
                        android:text = "solothurn@global-parner.ch"
                        android:paddingTop = "8dip"
                        android:textColor = "#22F"
                        android:textSize = "16dip"
                        android:linksClickable ="true"/>        
            </LinearLayout>
            <View 
                android:layout_width="fill_parent"
                android:layout_height="15dip"/>
                </LinearLayout>
            </LinearLayout>
        </ScrollView>
    <LinearLayout
        android:layout_width ="fill_parent"
        android:layout_height ="wrap_content"
        android:layout_weight = "0"
        android:orientation ="horizontal"
        >
            <Button
                android:id = "@+id/btnCall"
                android:layout_width ="fill_parent"
                android:layout_height ="fill_parent"
                android:layout_weight = "1"
                android:text="@string/call"
                android:textColor="#000"
                android:drawableTop = "@drawable/cal_icon_hoverl"/>
            <Button
                android:id = "@+id/btnMail"
                android:layout_width ="fill_parent"
                android:layout_height ="fill_parent"
                android:textColor="#000"
                android:layout_weight = "1"
                android:text="@string/mail" 
                android:drawableTop = "@drawable/mail_icon_hover"/>
            <Button
                android:id = "@+id/btnFa"
                android:layout_width ="fill_parent"
                android:layout_height ="fill_parent"
                android:textColor="#000"
                android:layout_weight = "1"
                android:text="@string/favorite"
                android:singleLine="true"
                android:drawableTop = "@drawable/favoriate_icon_hover"/>

  </LinearLayout>
</LinearLayout>


You cannot have a scrollview inside a scrollview. It is similar having a listview or a gridview inside a scrollview. They simply don't scroll. So my advice is to restructure your layout in order to achieve the desired behavior.


It seems there is a issue with scrolling webpages from file:///. The only solution I came up with was to use an innerscrolling in the local Webpages. For that I used a modified script as downloadable at http://cubiq.org/iscroll-4 . The only modification I did was set the height and line-height of the header and footer to 0px in the css. And it works. Maybe it helps you too.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜