0
0

More than 3 years have passed since last update.

botton,textviewなどのスタイルの変え方

Posted at

方法

drawable.xmlファイルに使いたいスタイルを新規作成し、xmlのandroid:backgroundに設定するだけ

自作androidアプリ Flexible Dice の場合。
Google Play で手に入れよう
このアプリではTextViewのスタイルを変更してダイスを表示しています。

1.drawable.xmlの新規作成
まずはスタイルを指定するdrawableファイルを作成します。
ここへ新規作成
image.png
中身はこんな感じ。背景色・枠線の丸み、幅、色を設定しています。
image.png

2.設定したい箇所への設定
こんな感じで、設定したい箇所のxmlにandroid:backgroundを追記
image.png

3.結果
textviewに設定するとこんな感じになります。Flexible Dice ではこれをダイスのUIとして使っています。
image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0