I am trying to create a parallelogram background for my text view but it is not displaying properly ... The following output displays
& lt; Layer-list & gt; & Lt; Items & gt; & Lt; Rotate Android: fromDegrees = "10" Android: toDegrees = "10" Android: Peugeot X = "- 40%" Android: Pvtv = "87%" & gt; & Lt; Size Android: shape = "rectangle" & gt; & Lt; Stroke Android: Color = "# 000000" Android: width = "10dp" /> & Lt; / Size & gt; & Lt; / Rotate & gt; & Lt; / Item & gt; & Lt; / Layer-list & gt;
I need output like this ........
@ mmlooloo's answer options In the one who gets a credit, I suggest an XML-Draw qualified solution (because you have not emphasized depending on the type of solution you have searched for). In the example below I used a normal view
, although you can use any other.
Here view
& lt; See Android: layout_width = "100dp" Android: layout_height = "40dp" Android: layout_centerInparent = "true" Android: background = "@drawable / shape" />
and size. Xml
auto
& lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Layer-list xmlns: android = "http://schemas.android.com/apk/res/android" & gt; & Lt ;! - colored rectangle - & gt; & Lt; Items & gt; & Lt; Size Android: shape = "rectangle" & gt; & Lt; Size Android: width = "100dp" Android: height = "40dp" /> & Lt; Solid Android: Color = "# 13A8 9" /> & Lt; / Size & gt; & Lt; / Item & gt; & Lt ;! - This rectangle for the left - & gt; & Lt ;! - Its color should be similar to the background of the layout - & gt; & Lt; Item android: right = "100dp" Android: left = "- 100dp" android: top = "- 100dp" Android: Below = "- 100dp" & gt; & Lt; Swirl Android: fromDegrees = "45" & gt; & Lt; Size Android: shape = "rectangle" & gt; & Lt; Solid Android: color = "# ffffff" /> & Lt; / Size & gt; & Lt; / Rotate & gt; & Lt; / Item & gt; & Lt ;! - This rectangle for the right side - & gt; & Lt ;! - Their color should be similar to the background of the layout - & gt; & Lt; Android: Right = "- 100 DP" Android: Left = "100 DP" Android: Top = "- 100 DP" Android: Below = "- 100 DP" & gt; & Lt; Swirl Android: fromDegrees = "45" & gt; & Lt; Size Android: shape = "rectangle" & gt; & Lt; Solid Android: color = "# ffffff" /> & Lt; / Size & gt; & Lt; / Rotate & gt; & Lt; / Item & gt; & Lt; / Layer-list & gt;
Here looks like:
No comments:
Post a Comment