Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I remember having trouble with the <code>ScrollView</code> somehow not making it to the end of it's contents when the content layout had a top margin. I solved the problem with a little hack, adding an empty view to the end of the <code>LinearLayout</code>:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" tools:context=".ArticleFragment" &gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="10dp" android:layout_margin="16dp" &gt; &lt;TextView android:id="@+id/article_title" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:textIsSelectable="true" android:background="@color/page_background" /&gt; &lt;TextView android:id="@+id/article_content" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textIsSelectable="true" android:background="@color/page_background" /&gt; &lt;!-- Add a little space to the end --&gt; &lt;View android:layout_width="fill_parent" android:layout_height="30dp" /&gt; &lt;/LinearLayout&gt; &lt;/ScrollView&gt; </code></pre> <p>I used a similar empty view also in the beginning of the <code>LinearLayout</code> to avoid top/bottom margins completely.</p> <p>EDIT: I just realised that you also wanted the end of the "paper" to show up when reaching the end of the view. In that case you might want to set the background color to the <code>TextView</code>s instead of the layout itself. Then make sure there's no margin between the title and the article (use padding as separation).</p> <p>EDIT2: I should learn to check when the questions were asked... Well, maybe this still helps someone. :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload