ScrollView cutting off buttons with gradient
<p>This is all done dynamically.</p>

<p>My buttons load fine into a scroll view however when the user scroll the screen the right side of the buttons get cut off a little losing there rounded edge.  </p>

<p>so it would look like this </p>

<p>(---) (---)</p>

<p>(---) (---)</p>

<p>(---) (---)</p>

<p>then change to this</p>

<p>(--   (-- </p>

<p>(--   (-- </p>

<p>(--   (-- </p>

<p>When I add in my graident.</p>

<p><strong>xml page</strong> </p>

<pre><code>   &lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" &gt;

    &lt;LinearLayout
        android:id="@+id/home_page_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingLeft="5dp"
        android:paddingRight="5dp" &gt;

        &lt;ImageView
            android:id="@+id/imageView1"
            android:layout_width="match_parent"
            android:layout_height="0dip"
            android:layout_gravity="center"
            android:layout_weight=".2"
            android:contentDescription="@string/logo_image_description"
            android:scaleType="fitXY"
            android:src="@drawable/logo" &gt;
        &lt;/ImageView&gt;

        &lt;WebView
            android:id="@+id/wv_Welcome_Message"
            android:layout_width="match_parent"
            android:layout_height="match_parent" &gt;
        &lt;/WebView&gt;
    &lt;/LinearLayout&gt;

&lt;/ScrollView&gt;
</code></pre>

<p><strong>Relevant java code</strong></p>

<pre><code>// Set Layout Parameters for LinearLayouts. (Height, Width,
    // Weight,Padding)
    params_linearlayout = new LinearLayout.LayoutParams(
            LinearLayout.LayoutParams.MATCH_PARENT,
            LinearLayout.LayoutParams.WRAP_CONTENT, 1.0f);

    // Set Layout Parameters for Buttons. (Height, Width,
    // Weight,Padding)
    params_button = new LinearLayout.LayoutParams(
            LinearLayout.LayoutParams.MATCH_PARENT, 32, 1.0f);
    params_button.setMargins(10, 0, 10, 30);

    // Reference Layout and set background color
    home_page_layout = (LinearLayout) findViewById(R.id.home_page_layout);
    home_page_layout.setBackgroundColor(Color.parseColor(backgroundColor));
    home_page_layout.invalidate();

    // Create Button Gradient
    g = new GradientDrawable(Orientation.BOTTOM_TOP, new int[] {
            getResources().getColor(R.color.black),
            Color.parseColor(buttonBackgroundColor),
            Color.parseColor(buttonBackgroundColor) });
    g.setGradientType(GradientDrawable.LINEAR_GRADIENT);
    g.setGradientRadius(140.0f);
    g.setGradientCenter(0.0f, 0.45f);
    g.setCornerRadius(10);

            public void Load_Main_Menu(String[] buttons) {

    arrayButtonTitles = buttons;
    int numberOfButtons = arrayButtonTitles.length;
    LinearLayout[] ll = new LinearLayout[numberOfButtons];

    // Add Elements to Layout
    for (int i = 0; i &lt; numberOfButtons; i++) {

        Button btn = new Button(this);
        btn.setText(arrayButtonTitles[i]);
        btn.setTag(i);
        btn.setOnClickListener(myListener);
        btn.setTypeface(face);
        btn.setTextSize(18);
        btn.setTextColor(Color.parseColor(buttonFontColor));
        btn.setPadding(10, 7, 10, 7);
        btn.setBackgroundDrawable(g);
        if (i % 2 == 0) {
            ll[i] = new LinearLayout(this);
            ll[i].setOrientation(LinearLayout.HORIZONTAL);
            ll[i].addView(btn, params_button);
            home_page_layout.addView(ll[i], params_linearlayout);
        } else {
            ll[i - 1].addView(btn, params_button);
        }
    }
}
</code></pre>
