I am using a TextView nested inside a ScrollView. Scrolling works fine, but the ScrollView seems to add an extra padding on the top of the TextView that looks like this:
<ScrollViewTop>
<Padding>
<TextViewTop>
<TextViewContent>
<TextViewBottom>
<ScrollViewBottom>
Note that this only happens at the top of the TextView and that the space is static, does not move when scrolling. This is the layout I am using inside a DialogFragment:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:fadingEdge="none"
android:orientation="vertical" >
<TextView
android:id="@+id/textViewHelp"
android:adjustViewBounds="true"
android:scrollbars = "vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
</ScrollView>
And here is the Fragment that contains the layout:
public class HelpDialogFragment extends DialogFragment {
public interface HelpDialogFragmentListener {
void onFinishHelpDialogFragment(String inputText);
}
//empty constructor for fragment (android requirement)
public HelpDialogFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.help_fragment, container);
TextView tv = (TextView) view.findViewById(R.id.textViewHelp);
tv.setText(Html.fromHtml(Utils.loadHtmlFromResources(getActivity(), R.raw.help)));
return view;
}
}
How can I force the TextView to take up the entire ScrollView area?