& lt; LinearLayout XMLNS: android="http://schemas.android.com/apk/res/android"
XMLNS: tools="http://schemas.android.com/tools"
Android: layout_width="match_parent"
Android: layout_height="match_parent"
Tools: context="com. Example. Colore. MainActivity"
Android: orientation="vertical" & gt;The android: id="@ + id/TV"
Android: layout_width="wrap_content"
Android: layout_height="wrap_content"/& gt;Android: layout_width="wrap_content"
Android: layout_height="wrap_content"
Android: text="(0 x0012faff 0 x00ff0000) & gt;> 16==0 x12 "/& gt;Android: layout_width="wrap_content"
Android: layout_height="wrap_content"
Android: columnCount="3"
The android: orientation="horizontal"
Android: rowCount="3" & gt;Android: layout_width="80 dp"
Android: layout_height="80 dp"
Android: background="# 00 ff0000"
Android: text="0 x00ff0000"/& gt;Android: layout_width="80 dp"
Android: layout_height="80 dp"
Android: background="# 00000012"
Android: text="0 x12"/& gt;Android: layout_width="80 dp"
Android: layout_height="80 dp"
Android: background="# 0012 faff"
Android: text="0 x0012faff"/& gt;Android: layout_width="80 dp"
Android: layout_height="80 dp"
Android: background=# 0000 ff00 ""
Android: text="0 x0000ff00"/& gt;Android: layout_width="80 dp"
Android: layout_height="80 dp"
Android: background="# 000000 fa"
Android: text="0 xfa/& gt;"Android: layout_width="80 dp"
Android: layout_height="80 dp"
Android: background="# 000000 ff"
Android: text="0 x000000ff"/& gt;Android: layout_width="80 dp"
Android: layout_height="80 dp"
Android: background="# 000000 ff"
Android: text="0 XFF"/& gt;Android: layout_width="80 dp"
Android: layout_height="80 dp"
Android: background="# 66 CCCC
"Android: text="0 x66cccc"/& gt;Android: layout_width="80 dp"
Android: layout_height="80 dp"
Android: background="# 339933"
Android: text="0 x339933"/& gt;
public class MainActivity extends the Activity {
@ Override
Protected void onCreate (Bundle savedInstanceState) {
Super. OnCreate (savedInstanceState);
setContentView(R.layout.activity_main);
TextView TextView=(TextView) the findViewById (R.i which v);
//use the color of the actual value is set the font color
TextView. SetTextColor (android. Graphics. Color argb (127, 255, 0, 255));
}
}
CodePudding user response:
In RGB color, use # + 2 transparency value (omitted) + 6 RBG value indicates a full color, transparency can be omitted, omit said auto-complete opaque, you value transparency a 00 said fully transparent, so what color is transparent, should use the FF,CodePudding user response:
,,,,,,,,,,,,,, there is something wrong with the color value