set background color: Android

前端 未结 4 552
旧时难觅i
旧时难觅i 2020-12-29 02:22

How Do I set the background color of my android app. When I try:

LinearLayout li=(LinearLayout)findViewById(R.id.myLayout);
li.setBackgroundColor(Color.parse         


        
4条回答
  •  春和景丽
    2020-12-29 02:49

    By the way, a good tip on quickly selecting color on the newer versions of AS is simply to type #fff and then using the color picker on the side of the code to choose the one you want. Quick and easier than remembering all the color hexadecimals. For example:

    android:background="#fff"
    

提交回复
热议问题