Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用动态主题颜色并从服务器获取颜色,请问最好的方法是什么,如果我可以从 java 中编辑 xml 中的颜色属性,我该怎么做。
你想改变什么颜色?布局背景颜色?
LinearLayout ll = (LinearLayout) findViewById(R.id.linearLayout); int color = Color.argb(255, 255, 0, 255); // Use your values from the server here ll.setBackgroundColor(color);