Setting background colour of Android layout element

后端 未结 9 1919
北海茫月
北海茫月 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:33

    Kotlin

    linearLayout.setBackgroundColor(Color.rgb(0xf4,0x43,0x36))
    

    or

    #f44336
    

    -

    linearLayout.setBackgroundColor(ContextCompat.getColor(vista.context, R.color.newColor))
    

提交回复
热议问题