horizontalscrollviewのfillviewportオールスクロール?
-
24-10-2019 - |
質問
私はこのレイアウトでスケール妙(おそらくよりinadviseableレイアウトの営巣場合は使用しておりませんfillviewport=trueっHorizontalScrollView.
べての動作peachyを除く、奇数スケーリング)がfillviewport=falseがfillviewport=true、スケーリングに最適なスクロールなどが挙げられる。
このレイアウト(注:ってはいけないことになって入れるwebviewでscrollview.がwebviewいsmoothscrolltoもなsetscroller方法はないので。bleh.)
<?xml version="1.0" encoding="utf-8"?>
<HorizontalScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webContainer"
android:layout_below="@+id/titlebar"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true">
<WebView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webZ"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</HorizontalScrollView>
設定android:fillViewport="true"ません通常は無効にスクロールするこのポウサダはサルバドールなのですか?
だが必ずscrollviewを埋め、ビューポートにかかわらずサイズのコンテンツeh?と思い、ビューポートが可視領域の画面がありコンテンツの端に可視領域のwebviewんのスクロールです。
らしいlogcatにスクロール方法が呼ばれることを思い、画面を切り替えてください.除設定しますfillviewportをfalseになります。)
解決
問題はご使用になること"fill_parentことができて私の親分です。" 利用wrap_contentの幅です。
他のヒント
出会う同様の問題が標準ScrollViewを含むWebView:をスクロールはありません。変化のfill_parentにwrap_contentなった。
の例ではCgiのような細かい作業時のビューはTextViewがない場合での交換によるWebView.
何がうまくいきません:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:orientation="vertical">
<WebView android:id="@+id/webview"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_weight="1.0">
</WebView>
<Button
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:text="Click">
</Button>
</LinearLayout>
</ScrollView>
時を追加する少量のデータは、webviewでok:
しかし、WebViewで多くのデータを取得することはできませんでついて(通知)"がありました。
ボタンが常に表示され、スクロールは動作しなくなります。実際に、タッチスクロール動作しないのDPADスクロールし---
かつ付加価値をつけられるというものか回避策:では、追加LinearLayoutを含むWebView
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout android:id="@+id/linearlayout"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_weight="1.0"
android:orientation="vertical">
<WebView android:id="@+id/webview"
android:layout_width="fill_parent" android:layout_height="wrap_content">
</WebView>
</LinearLayout>
<Button
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:text="Click">
</Button>
</LinearLayout>
</ScrollView>
現在で動作す: