Browsed by
Category: Xamarin

Xamarin Forms Named font sizes

Xamarin Forms Named font sizes

Xamarin.Forms defines fields in the NamedSize enumeration that represent specific font sizes. The following table shows the NamedSize members, and their default sizes on iOS, Android, and the Universal Windows Platform (UWP): Member iOS Android UWP Default 16 14 14 Micro 11 10 15.667 Small 13 14 18.667 Medium 16 17 22.667 Large 20 22 32 Body 17 16 14 Header 17 96 46 Title 28 24 24 Subtitle 22 16 20 Caption 12 12 12 Named font sizes can be set through both…

Read More Read More

Hosts files and the Google Android emulator

Hosts files and the Google Android emulator

Using the Google Android emulator is a good way to test how a website behaves on Android devices. Connecting to your local computer http://10.0.2.2 is the URL to connect to a website hosted on your local computer. localhost or 127.0.0.1 will not work! This is all defined in the documentation on Android emulator networking. Using a hosts file The Android emulator will not make use of your local hosts file. This is unfortunate when your website relies on host headers to work…

Read More Read More

Xamarin Forms: Lazy load tabs in TabbedPage

Xamarin Forms: Lazy load tabs in TabbedPage

Source: https://enginecore.blogspot.com/2019/01/xamarin-forms-lazy-load-tabs-in_10.html In Xamarin Forms, we sometimes need the TabbedPage to display a tab layout. You can checkout the great official documentation hereabout how to create and use a TabbedPage. Problem: Every tab is a Page instance The TabbedPage is a multi page container where every tab is a Page object. No matter how you create the tabs (either by setting the TabbedPage.Children page collection with Page instances or by setting TabbedPage.ItemsSource and TabbedPage.ItemTemplate) the TabbedPage needs a Page instance for every tab and uses the Page.Title property to display the text header on the tab…

Read More Read More

How can I run a method in the background on my Xamarin app?

How can I run a method in the background on my Xamarin app?

Source: https://stackoverflow.com/questions/45209784/how-can-i-run-a-method-in-the-background-on-my-xamarin-app/45210187 What we did in our forms application was to make use of the Device.Timer and the Stopwatch class that available in System.Diagnostics, and Xamarin.Forms to create a very generic managed timer that we could interact with using the onStart, onSleep and onResume methods in Xamarin.Forms. This particular solution doesn’t require any special platform specific logic, and the device timer and stopwatch are non UI blocking. Edit:  To give some context as to how the above solution works step by…

Read More Read More

Xamarin.Forms’s LayoutOptions

Xamarin.Forms’s LayoutOptions

Short answer Start, Center, End and Fill define the view’s alignment within its space. Expand defines whether it occupies more space if available. Theory The structure LayoutOptions controls two distinct behaviors: Alignment: How is the view aligned within the parent view? Start: For vertical alignment the view is moved to the top. For horizontal alignment this is usually the left-hand side. (But note, that on devices with right-to-left language setting this is the other way around, i.e. right aligned.) Center: The view is centered. End: Usually the view is bottom or right…

Read More Read More

Xamarin – When/Why use command

Xamarin – When/Why use command

Here’s a couple short features, but you really want to do more reading on the topic of commands because there is a bunch more to know that can be covered in a thread post. This is just my ‘major benefits’ explanation. Commands are less coupled than events. Think of them as the next evolution of the Event. For example, on an event you have to subscribe directly to that instance. MyClassInstance.SomeEvent += eventHandlerMethod(); Which most times means you have to…

Read More Read More