xamarin.forms

Reducing the size of UISwitch in Xamarin Forms does not work

旧时模样 提交于 2021-02-11 18:22:51
问题 In Xamarin Forms, I created a custom renderer for Switch . On iOS, I updated the scale transform to make it smaller than its default size: Control.Transform = CGAffineTransform.MakeScale((float)0.75, (float)0.75); While this successfully resizes the Switch , it doesn't resize its bounding box. How can I resize it as well? Here the background color of the Switch is set to red in XAML. It looks like the original bounds are still being maintained even though the thumb is smaller. 回答1: You can

Set CursorPosition in Editor Xamarin Forms

眉间皱痕 提交于 2021-02-11 18:21:48
问题 How can we set CursorPosition in Editor . We can set CursorPostion in Entry , but how to set it in Editor ? I know we can do it using Custom Renderer in Xamarin Forms, but how to implement it? 回答1: We cannot set CursorPosition in Editor as we set it in Entry . We need to use Custom Renderer . Using Custom Renderer makes most of the native functions and implementations possible in Xamarin Forms. To set Cursor Position in Editor in Xamarin Forms. This answer may be a bit lenghthier for

Set CursorPosition in Editor Xamarin Forms

余生长醉 提交于 2021-02-11 18:19:34
问题 How can we set CursorPosition in Editor . We can set CursorPostion in Entry , but how to set it in Editor ? I know we can do it using Custom Renderer in Xamarin Forms, but how to implement it? 回答1: We cannot set CursorPosition in Editor as we set it in Entry . We need to use Custom Renderer . Using Custom Renderer makes most of the native functions and implementations possible in Xamarin Forms. To set Cursor Position in Editor in Xamarin Forms. This answer may be a bit lenghthier for

Is this ExportRenderer still required in Xamarin Forms 4.4 +

a 夏天 提交于 2021-02-11 18:19:18
问题 I have a couple of questions about the WKWebview in Xamarin Forms 1) From https://github.com/xamarin/Xamarin.Forms/pull/3346: To opt-in to using WkWebView add the following to the AssemlyInfo.cs file of your iOS C# project file [assembly: ExportRenderer(typeof(WebView), typeof(Xamarin.Forms.Platform.iOS.WkWebViewRenderer))] Is this assembly still necessary to use in Xamarin Forms 4.4? Apparently WKWebView is the default view in XF4.4 so it's unnecessary? 2) Are there any visual changes

Is this ExportRenderer still required in Xamarin Forms 4.4 +

空扰寡人 提交于 2021-02-11 18:18:19
问题 I have a couple of questions about the WKWebview in Xamarin Forms 1) From https://github.com/xamarin/Xamarin.Forms/pull/3346: To opt-in to using WkWebView add the following to the AssemlyInfo.cs file of your iOS C# project file [assembly: ExportRenderer(typeof(WebView), typeof(Xamarin.Forms.Platform.iOS.WkWebViewRenderer))] Is this assembly still necessary to use in Xamarin Forms 4.4? Apparently WKWebView is the default view in XF4.4 so it's unnecessary? 2) Are there any visual changes

How to Display Picker when page load without tapping on title Xamarin.Forms

帅比萌擦擦* 提交于 2021-02-11 17:39:33
问题 Hi I am using a Picker to display some values to be select. <Picker x:Name="selection" Title="Select Option"> <Picker.ItemsSource> <x:Array Type="{x:Type x:String}"> <x:String>Episode</x:String> <x:String>All</x:String> <x:String>Department</x:String> <x:String>Section</x:String> </x:Array> </Picker.ItemsSource> </Picker> This is not displaying when page load only Title will display. When I tap on title it will display the picker. but I want to display picker when page load... How can I do

Having trouble using MessagingCenter to send a message from Android MainActivity to view model class not in Android project

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-11 17:00:19
问题 I attempted to follow the instructions found here to add a MessagingCenter subscribe action on a notification tap that would open a specific view. Somewhere my Send / Subscribe aren't talking to each other and I just can't see where. The details of the messaging center are still new to me so I'm sure I just used the wrong class or sender somewhere. The code below has since been modified from what was shown to me in the link. The idea is still roughly the same though. Here's the

Having trouble using MessagingCenter to send a message from Android MainActivity to view model class not in Android project

半腔热情 提交于 2021-02-11 16:58:46
问题 I attempted to follow the instructions found here to add a MessagingCenter subscribe action on a notification tap that would open a specific view. Somewhere my Send / Subscribe aren't talking to each other and I just can't see where. The details of the messaging center are still new to me so I'm sure I just used the wrong class or sender somewhere. The code below has since been modified from what was shown to me in the link. The idea is still roughly the same though. Here's the

Camera capture image rotate to portrait - Xamarin android

女生的网名这么多〃 提交于 2021-02-11 16:48:21
问题 I have a xamarin.android project which have a custom camera Preview. Whenever I initialize the camera , it will open as landscape default. So I changed the orientation from SurfaceChanged method like this. private int setCameraDisplayOrientation(Activity mContext, int v) { var degrees = 0; var orientation =0; Display display = mContext.GetSystemService(Context.WindowService).JavaCast<IWindowManager>().DefaultDisplay; Camera.CameraInfo info = new Camera.CameraInfo(); Camera.GetCameraInfo(v,

Camera capture image rotate to portrait - Xamarin android

混江龙づ霸主 提交于 2021-02-11 16:44:51
问题 I have a xamarin.android project which have a custom camera Preview. Whenever I initialize the camera , it will open as landscape default. So I changed the orientation from SurfaceChanged method like this. private int setCameraDisplayOrientation(Activity mContext, int v) { var degrees = 0; var orientation =0; Display display = mContext.GetSystemService(Context.WindowService).JavaCast<IWindowManager>().DefaultDisplay; Camera.CameraInfo info = new Camera.CameraInfo(); Camera.GetCameraInfo(v,