怎么做"文章喜欢"布局?

时间:2017-02-18 05:09:22

标签: android-layout

我是新手,我不知道这叫什么,所以我不能谷歌。

我想制作一篇像布局"的文章。在我的滚动视图上。 我怎样才能在滚动视图中添加这样的内容?

1 个答案:

答案 0 :(得分: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希望这会对你有所帮助。