Setting background colour of Android layout element

后端 未结 9 1920
北海茫月
北海茫月 2020-12-02 03:42

I am trying to, somewhat clone the design of an activity from a set of slides on Android UI design. However I am having a problem with a very simple task.

I have cre

9条回答
  •  情书的邮戳
    2020-12-02 04:29

    If you want to change a color quickly (and you don't have Hex numbers memorized) android has a few preset colors you can access like this:

    android:background="@android:color/black"
    

    There are 15 colors you can choose from which is nice for testing things out quickly, and you don't need to set up additional files.

    Setting up a values/colors.xml file and using straight Hex like explained above will still work.

提交回复
热议问题