2017-02-18 27 views

回答

1

你所問的是工作,你必須圖書館粘貼此代碼在您的gradle這個

dependencies { 

compile 'com.android.support:cardview-v7:23.3.+' 

}

,並把這樣的

<android.support.v7.widget.CardView 
    xmlns:card_view="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/card_view" 
    android:layout_gravity="center" 
    android:layout_width="250dp" 
    android:layout_height="250dp" 
    card_view:cardCornerRadius="4dp"> 

    <TextView 
     android:text="Hello Card" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" /> 

</android.support.v7.widget.CardView> 

內容的卡片視圖這裏是一個tutorial 並使其看起來像圖像一樣儘量使用自定義字體 你可以設置我喜歡這個

` TextView tx = (TextView)findViewById(R.id.textview1); 

Typeface custom_font = Typeface.createFromAsset(getAssets(), "fonts/abc.ttf"); 

tx.setTypeface(custom_font);` 

更多關於custom font希望這可以幫到你。

相關問題