title: To get a Triangle Shaped Background for TextView
body: <p>I'm trying to fix a triangle shaped background for a TextView as shown <a href="https://i.stack.imgur.com/uarRb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uarRb.png" alt="below"></a>.</p>
  
  <p>I'm using the following XML code:</p>
  
  <pre><code>&lt;TextView
          android:id="@+id/type_textView"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentRight="true"
          android:background="@drawable/triangle_bg"
          android:padding="1dp"
          android:text="Sponsors"
          android:textColor="#ffffff" /&gt;
  </code></pre>
  
  <p>Here's the code for triangle_bg.xml</p>
  
  <p></p>
  
  <pre><code>&lt;item&gt;
      &lt;rotate
          android:fromDegrees="45"
          android:pivotX="90%"
          android:pivotY="-50%"
          android:toDegrees="-45" &gt;
          &lt;shape android:shape="rectangle" &gt;
              &lt;stroke
                  android:width="1dp"
                  android:color="@android:color/transparent" /&gt;
  
              &lt;solid android:color="#00C6FF" /&gt;
          &lt;/shape&gt;
      &lt;/rotate&gt;
  &lt;/item&gt;
  </code></pre>
  
  <p></p>
  
  <p>the resultant image in my xml using the above code looks as <a href="https://i.stack.imgur.com/Gr7I3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Gr7I3.png" alt="below"></a></p>
  
  <p>Can anyone tell me how I can achieve the triangle background as shown in my first background..??
  Thanks in Advance</p>
  
  <p>I've an idea of placing an Image instead of using a textview. But I would like to know whether there is any option to use textview. Please help if any!!!</p>