2017-07-27 34 views
0

我試圖改變文字顏色和消除這種左圖標更改默認的UI:如何從布倫特裏卡表與Android

enter image description here

所以對於CardNumber我用另一種觀點來單獨更改

//ONLY THE CARD ENTRY 
<com.braintreepayments.cardform.view.CardForm 
     android:id="@+id/card_form" 
     style="@style/MyCard" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" /> 
//EXPIRATION,CVV,POSTALCODE 
<com.braintreepayments.cardform.view.CardForm 
     android:id="@+id/card_formTwo" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" /> 

而此次嘗試應用它們,但仍然沒有工作..

<style name="MyCard" parent="Theme.AppCompat.Light.DarkActionBar"> 
    <item name="android:hint">EAEE</item> 
</style> 

CardForm

回答

1

我還沒有檢查,如果這段代碼的作品,但我想它會給你一個方向至少。這是我想如何刪除圖標:

CardForm cardForm = (CardForm) findViewById(R.id.card_form); 
cardForm.setCardNumberIcon(0); 
cardForm.setPostalCodeIcon(0); 

另一方面,文字顏色似乎不可改變。您只能根據documentation on styling修改口音的顏色,但您可以嘗試改變文字顏色太(綠色口音和藍色在下面的示例文本顏色):

<style name="MyCard"> 
    <item name="android:colorAccent">#91beae</item> 
    <item name="android:textColor">#3b5998</item> 
</style> 
+0

cardForm.setCardNumberIcon(0);刪除卡牌的右側圖標,但不在左側。但是,謝謝! –