private void Initialize(Context context, IAttributeSet attrs) { var array = context.ObtainStyledAttributes(attrs, Resource.Styleable.CustomTextView); var textStyle = array.GetString(Resource.Styleable.CustomTextView_textStyle); var type = TypefaceHelper.GeTypeface(context, textStyle); SetTypeface(type, TypefaceStyle.Normal); }
private void Init(Context context) { var type = TypefaceHelper.GeTypeface(context); SetTypeface(type, TypefaceStyle.Normal); this.AfterTextChanged += (sender, args) => { this.SetSelection(this.Text.Length); }; }
protected override void OnElementChanged(ElementChangedEventArgs <Label> e) { base.OnElementChanged(e); TextView native = Control as TextView; LabelIcon newElement = e.NewElement as LabelIcon; if (native != null && newElement != null) { var fontFamily = string.IsNullOrEmpty(newElement.FontFamily) ? "Fonts/DynamicsSymbol.ttf" : e.NewElement.FontFamily.TrimStart('/').Replace("Assets/", string.Empty); native.Typeface = TypefaceHelper.GetTypeface(Forms.Context, fontFamily); } }
private void Init(Context context, IAttributeSet attrs) { ; var array = context.ObtainStyledAttributes(attrs, Resource.Styleable.CustomTextView); var textStyle = array.GetString(Resource.Styleable.CustomTextView_textStyle); var type = TypefaceHelper.GeTypeface(context, textStyle); SetTypeface(type, TypefaceStyle.Normal); var background = attrs.GetAttributeValue("http://schemas.android.com/apk/res/android", "background"); if (String.IsNullOrEmpty(background)) { SetBackgroundResource(Android.Resource.Color.Transparent); } }
private void TypefaceSelectionDialogue_Load(object sender, EventArgs e) { TypefaceHelper.InitialiseTypefaceFamilies(kcmbSelectedTypeface); TypefaceHelper.InitialiseTypefaceStyles(klbTypefaceStyles); }
private void Initialize(Context context) { var type = TypefaceHelper.GeTypeface(context); SetTypeface(type, TypefaceStyle.Normal); }