2017-07-21 8 views
-2

下の画像の下部にあるTextViewの背景効果を実現したいと思います。私の下手な英語のため申し訳ありません ... enter image description here白いテキストのTextView

+0

イメージのテキストビューはどういう意味ですか? – rubenwardy

+0

実行時にテキストビューの色を変更していますか? –

+0

setBackgroundメソッドを使用し、グラデーションを使用してカスタムドロアブルを作成します。 –

答えて

1

あなたはあなたの背景描画可能

your_drawable.xml

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
    android:shape="oval"> 
    <gradient android:angle="0" 
     android:endColor="#fff" 
     android:startColor="#c86e6e6e" 
     android:gradientRadius="100dp" 
     android:type="radial"/> 
</shape> 

とのTextViewに追加作成することができます:あなたが持っている

<TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="TEST" 
     android:textColor="#fff" 
     android:background="@drawable/your_drawable" 
     android:padding="90dp" 
     android:textSize="30sp"/> 
+0

あなたのanwserは正しいです。それは私に影響を与えました。ありがとう! –

0

をグラデーションスケールを使用します。 go詳細については、ドキュメントを確認してください

関連する問題