Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>Edit:</strong> The easiest solution is to get rid of the rounded corners. If you remove the rounded corners and use a simple rectangle, the hardware renderer will no longer create a single large texture for the background layer, and won't run into the texture size limit any more.</p> <hr> <p>One simple workaround <em>should</em> be to revert to software rendering for that view:</p> <pre><code>View view = findViewById(R.id.textView1); view.setLayerType(View.LAYER_TYPE_SOFTWARE, null); </code></pre> <p>...but we've run into a similar problem here and we got the same result you did, the view (and its children) didn't render.</p> <p>You can also set the layer type of a view <a href="http://developer.android.com/reference/android/view/View.html#attr_android%3alayerType" rel="nofollow">from XML</a>:</p> <pre><code>&lt;TextView android:layerType="software" /&gt; </code></pre> <p>Setting the layerType to "none" instead of software seems to cause the view to draw, but it drew without the rounded corners in a quick test we just tried.</p> <p>Another approach might be to use a different method of rendering the rounded rectangle, e.g.</p> <ul> <li>clipping and drawing the path yourself in <code>onDraw</code></li> <li>using a <a href="http://developer.android.com/reference/android/graphics/drawable/PaintDrawable.html" rel="nofollow"><code>PaintDrawable</code></a> (which supports rounded corners, but must be set from code)</li> <li>breaking the rectangle into three slices -- a top (with rounded corners), middle (just a solid color), and bottom (with rounded corners)</li> </ul>
 

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