grantland / android-autofittextview

A TextView that automatically resizes text to fit perfectly within its bounds.
Apache License 2.0
4.27k stars 689 forks source link

SetTextSize on Runtime? #44

Open KingWu opened 9 years ago

KingWu commented 9 years ago

i found that change the AutoFitTextView font size, style on Runtime exist issue. Thanks

grantland commented 9 years ago

Could you elaborate a bit more what your bug report is with possible code samples and screenshots?

sattha commented 8 years ago

size is not fit to its width when use setText at runtime

actvCOD.setText("a long long long String);

 <me.grantland.widget.AutofitLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <AutoCompleteTextView
                        android:id="@+id/actvCOD"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="10dp"
                        android:hint="@string/booking_edit_hint_cod"
                        android:drawableLeft="@drawable/ic_cod_grey"
                        android:drawableStart="@drawable/ic_cod_grey"
                        android:paddingLeft="@dimen/padding_default"
                        android:paddingRight="@dimen/padding_default"
                        android:textSize="@dimen/booking_edit_tv_cod_text_size"
                        android:singleLine="true"
                        android:focusable="false"
                        android:editable="false"
                        android:background="@color/app_white"
                        android:textColor="@color/app_black"
                        style="@style/Widget.AppCompat.AutoCompleteTextView"
                    />

</me.grantland.widget.AutofitLayout>