【开源】android-autofittextview

android-autofittextview

 

使用说明:

在代码中让任何view继承TextView:

1
AutofitHelper.create(textView);

在xml中让任何View继承自TextView

1
2
3
4
5
6
7
8
9
10
<me.grantland.widget.AutofitLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    >
    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:singleLine="true"
        />
</me.grantland.widget.AutofitLayout>

直接使用项目的内置控件

1
2
3
4
5
<me.grantland.widget.AutofitTextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:singleLine="true"
    />

posted on 2015-04-10 09:54  wasdchenhao  阅读(492)  评论(0)    收藏  举报

导航