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.
これを実行して、タイトル バーの色を変更しました。プログラムでそれを切り替える方法を理解しようとしていますか? ユーザーがボタンをクリックした場合、別の定義済みの色に切り替えたいとします。どうすればそれを行うことができますか?
プログラムでタイトル バーに色を適用することで、これを簡単に行うことができます。プログラムでレイアウトの色を変更するには、
textView.setBackgroundColor(R.color.titletextcolor);
ボタンクリックイベントでこれを動的に行うと、色が変化します。