0
ich eine benutzerdefinierte Textview erstellt, um eine neue Schriftart hinzuzufügen:Individuelle Textview schneidet mit wrap_content
public class CustomTextView extends TextView{
public CustomTextView(Context context, AttributeSet attrs, int defStyle){
super(context, attrs, defStyle);
setTypeface(SplashActivity.SECRET_CODE_TYPEFACE, Typeface.NORMAL);
}
public CustomTextView(Context context, AttributeSet attrs){
super(context, attrs);
setTypeface(SplashActivity.SECRET_CODE_TYPEFACE, Typeface.NORMAL);
}
public CustomTextView(Context context){
super(context);
setTypeface(SplashActivity.SECRET_CODE_TYPEFACE, Typeface.NORMAL);
}
}
Nun, wenn ich diese Textview verwenden, wird der Text abgeschnitten:
und hier ist meine XML:
<com.whereisthemonkey.sqlsheetmanager.Graphics.CustomTextView
android:layout_width="match_parent"
android:text="@string/title"
android:textSize="56sp"
android:layout_height="wrap_content"
android:gravity="center" />
Danke, es funktioniert noch besser bei der Verwendung von padding-bottom und padding-top –