2016-10-03 12 views
0

私はeditTextの境界線にのみグラデーションを追加したいと思います。境界線のみにグラデーションを適用するにはどうすればいいですか?残りは透明にする必要がありますか?アンドロイドでテキストを編集する際にグラデーションを追加する

enter image description here

+0

ありがとうございましたが、まだそれを考え出した、今それはあなたの期待のように表示さだと思いますか? –

答えて

-1

あなたbutton_border.xmlを作成し、描画可能な範囲内に保ちます。今

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
android:shape="rectangle"> 

<!-- view border color and width --> 
<stroke 
    android:width="1dp" 
    android:color="@color/white" > 
</stroke> 

<!-- The radius makes the corners rounded --> 
<corners 
    android:radius="2dp" > 
</corners> 

</shape> 

次のようにあなたのEditTextの背景を設定します。

android:background="@drawable/button_border" 
+0

これはグラデーションの背景を提供していません。 –

0
  • はそのレイアウトののEditText
  • レイアウトの設定グラデーションの背景色 ため
  • 設定マージン1DPを追加します。 edittextのEditText

のための白い背景を設定し

  • 私は

  • 関連する問題