WPF UserControl Design Time Size

For Blend, a little known trick is to add these attributes to your usercontrol or window: xmlns:d=”http://schemas.microsoft.com/expression/blend/2008″ xmlns:mc=”http://schemas.openxmlformats.org/markup-compatibility/2006″ mc:Ignorable=”d” d:DesignHeight=”500″ d:DesignWidth=”600″ This will set the design height and width to 500 and 600 respectively. However this will only work for the blend designer. Not the Visual Studio Designer. As far as the Visual Studio Designer … Read more

How to scale/resize text to fit a TextView?

The AutofitTextView library from MavenCentral handles this nicely. The source hosted on Github(1k+ stars) at https://github.com/grantland/android-autofittextview Add the following to your app/build.gradle repositories { mavenCentral() } dependencies { implementation ‘me.grantland:autofittextview:0.2.+’ } Enable any View extending TextView in code: AutofitHelper.create(textView); Enable any View extending TextView in XML: <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” /> … Read more