protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); var myView = FindViewById <CustomView>(Resource.Id.myView); var builder = new TextLayoutBuilder() .SetTextAppearance(this, Android.Resource.Style.TextAppearanceLarge) .SetText("TextLayoutBuilder makes life easy") .SetWidth(400, TextLayoutBuilder.MeasureModeAtMost); var layout = builder.Build(); myView.Layout = builder.Build(); myView.ForceLayout(); }
public static TextLayoutBuilder SetTextAppearance(this TextLayoutBuilder builder, Context context, int resId) { ResourceTextLayoutHelper.SetTextAppearance(builder, context, resId); return(builder); }