<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <!-- ボタンが押されたときの定義 --> <item android:state_pressed="true" > <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#ffffff" /> <stroke android:width="5dp" android:color="#000000" /> </shape> </item> <!-- ボタンが押されていないときの定義 --> <item android:state_pressed="false"> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#555555" /> <stroke android:width="5dp" android:color="#000000" /> </shape> </item> </selector>
上の記述は、ボタンの形状です。ボタンには<stroke>タグで枠が設定されてます。押したらボタンの色が変わります。
この枠の一辺を消したいです。 例え:border-top border-left
下のはボーダーの一辺(top,left)を消した状態です。
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:top="-5dp" android:left="-5dp"> <shape> <solid android:color="#555555" /> <stroke android:width="5dp" android:color="#000000" /> </shape> </item> </layer-list>
上2つの記述の合体はできるのでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/12/06 01:10