How to format date and time in XAML in Xamarin application
Change your code to: <Label Text=”{Binding Date, StringFormat=”{0:MMMM dd, yyyy}”}”></Label> <Label Text=”{Binding Time, StringFormat=”{}{0:hh\\:mm}”}”></Label>
Change your code to: <Label Text=”{Binding Date, StringFormat=”{0:MMMM dd, yyyy}”}”></Label> <Label Text=”{Binding Time, StringFormat=”{}{0:hh\\:mm}”}”></Label>
<StackLayout> <StackLayout Orientation=”Horizontal” VerticalOptions=”Start”> <!– top controls –> </StackLayout> <StackLayout VerticalOptions=”CenterAndExpand”> <!– middle controls –> </StackLayout> <StackLayout Orientation=”Horizontal” VerticalOptions=”End”> <!– bottom controls –> </StackLayout> </StackLayout> Make sure to have no more than one child with Expand options for best performance.
I just implemented push notification a few days ago, and I’ll share my solution here (based on PushSharp) Step by step guide: 1) In your shared project, create an Interface called IPushNotificationRegister public interface IPushNotificationRegister { void ExtractTokenAndRegister(); } This interface is used for fetching the push token and then send it to the server. … Read more
Follow these steps: Update Xamarin.Forms from Nuget Package Manager Close Solution And Open In Run As Administrator mode Clean And Rebuild Solution.Now Try To Deploy Project
Updating Icon and Name (Android) If you changed the icon file name please ensure you update the Icon reference in MainActivity.cs: [Activity(Label = “MyName”, Icon = “@mipmap/myicon”, Theme = “@style/MainTheme”] public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity { } You should also update the names of icon.xml and icon_round.xml in the mipmap-anydpi folder to match to new … Read more
You can use Frame and put StackLayout inside , Note Frame take padding 20 by default : <Frame CornerRadius=”10″ OutlineColor=”Red” Padding=”0″> <StackLayout> </StackLayout> </Frame>
Here’s an answer that will work, but as @JamesMallon has mentioned, don’t use it: Device.BeginInvokeOnMainThread(ShowAlertAndWaitForUser(currentFabricCount).Result); Your issue is very common in situations where the code is not run in the Main/UI thread. It seems that you begin the invoke on the main thread but the UI thread doesn’t actually read the line, and another thread … Read more
You have a couple options. SQLite. This option is cross-platform and works well if you have a lot of data. You get the added bonus of transaction support and async support as well. EDIT: In the past I suggested using SQLite.Net-PCL. Due to issues involving Android 7.0 support (and an apparent sunsetting of support) I … Read more
UPDATE: This error doesn’t usually appear in VS 2015, if it does, here’s my original answer: Found the solution! Right click on the .XAML file, select Properties. You will see a Property called Custom Tool. Change its value from MSBuild:Compile to MSBuild:UpdateDesignTimeXaml This will solve the problem. Dont know about the downvote, but here’s my … Read more
In Android simply edit your styles.xml file under Resources\values adding this: <resources> <style name=”MyTheme” parent=”android:style/Theme.Material.Light.DarkActionBar”> <item name=”android:colorPressedHighlight”>@color/ListViewSelected</item> <item name=”android:colorLongPressedHighlight”>@color/ListViewHighlighted</item> <item name=”android:colorFocusedHighlight”>@color/ListViewSelected</item> <item name=”android:colorActivatedHighlight”>@color/ListViewSelected</item> <item name=”android:activatedBackgroundIndicator”>@color/ListViewSelected</item> </style> <color name=”ListViewSelected”>#96BCE3</color> <color name=”ListViewHighlighted”>#E39696</color> </resources>