前回はtextstyleとtypefaceを設定しました
textstyleとtypefaceを変更する
今回は
shadowColor 文字の影の色
shadowDx 影をX方向にずらす値
shadowDy 影をY方向にずらす値
shadowRadius 影のぼやけ具合
の設定をしたいと思います
shadowColorを赤に設定しそのほかのパラメータを変更していきたいと思います
main.xmlを以下のように変更しました
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="123 abc あいう" android:shadowColor="#f00"
android:shadowDx="10" android:shadowDy="10"
android:shadowRadius="1"/>
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="123 abc あいう" android:shadowColor="#f00"
android:shadowDy="10"
android:shadowRadius="1"/>
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="123 abc あいう" android:shadowColor="#f00"
android:shadowDx="10"
android:shadowRadius="1"/>
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="123 abc あいう" android:shadowColor="#f00"
android:shadowDx="-10" android:shadowDy="-10"
android:shadowRadius="1"/>
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="123 abc あいう" android:shadowColor="#f00"
android:shadowDy="-10"
android:shadowRadius="1"/>
<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="123 abc あいう " android:shadowColor="#f00"
android:shadowDx="-10"
android:shadowRadius="1"/>
<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="123 abc あいう " android:shadowColor="#f00"
android:shadowDx="5" android:shadowDy="5"
android:shadowRadius="5"/>
<TextView
android:id="@+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="123 abc あいう " android:shadowColor="#f00"
android:shadowDx="5" android:shadowDy="5"
android:shadowRadius="10"/>
</LinearLayout>
結果は以下のようになります影をずらしたりぼかしたりすることで雰囲気が出ます
スポンサードリンク


