2017-02-18 82 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希望这可以帮到你。