0

I try to make webView height wrap_content and use for scrolling an external scrollview. But in my case scrolls only webView and other views which placed below, not shown. I need to show checkbox and buttons just below the webView. Here is my layout. Probably there is some way to disable scrolling inside of webView? Does anyone trying to do something like this?

 <ScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginTop="8dp" android:orientation="vertical" android:paddingEnd="8dp" android:paddingStart="8dp"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:ellipsize="end" android:gravity="center" android:text="@string/signup_title_complete_registration" android:textColor="?android:textColorPrimary" android:textSize="24sp" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:ellipsize="end" android:gravity="center" android:text="@string/signup_subtitle_complete_registration" android:textColor="?android:textColorPrimary" android:textSize="14sp" /> <WebView android:id="@+id/disclosureWv" android:layout_width="match_parent" android:layout_height="match_parent" android:visibility="visible" /> <CheckBox android:id="@+id/chekBox" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="32dp" android:background="?selectableItemBackground" android:button="@null" android:checked="@={viewModel.agree}" android:drawableEnd="?android:listChoiceIndicatorMultiple" android:ellipsize="end" android:gravity="start|center" android:maxLines="4" android:paddingBottom="10dp" android:paddingTop="10dp" android:text="@string/signup_title_agreement_checkbox" android:textColor="?android:attr/textColorPrimary" android:textSize="16sp" android:textStyle="bold" /> <LinearLayout android:id="@+id/buttonContainer" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:padding="8dp"> <Button android:id="@+id/previousBtn" style="@style/Button.White.BlueStroke" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" android:layout_weight="1" android:onClick="@{() -> viewModel.onPreviousClicked()}" android:text="@string/general_button_previous_step" android:textColor="?android:textColorTertiaryInverse" android:textSize="16sp" /> <Button android:id="@+id/nextBtn" style="@style/Button.Positive" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginEnd="8dp" android:layout_marginStart="8dp" android:layout_weight="1" android:enabled="@{viewModel.enabled}" android:onClick="@{() -> viewModel.onNextClicked()}" android:text="@string/general_button_next" android:textSize="16sp" /> </LinearLayout> </LinearLayout> </ScrollView> 

how can i reach that behavior?

6
  • Try adding android:focusable="false" to the WebView. Commented Jul 12, 2018 at 8:11
  • Didn't help. Still scrolling Commented Jul 12, 2018 at 8:27
  • @ DanMan make android:layout_height="match_parent" as android:layout_height="wrap_content" in webview Commented Jul 12, 2018 at 9:30
  • I've already tried. In this case content trimmed from bottom. There is a text in the beginning then begins a white screen till the bottom Commented Jul 12, 2018 at 9:54
  • have you try this on WeightSum of Linearlayout..? Commented Jul 12, 2018 at 10:02

1 Answer 1

1

WebView content was trimmed only on emulator. When i built the app on a real device everything became fine

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.