Select text and copy from label xamarin forms - xamarin

I have for some days been reading on different forums about the issue of selecting a text and copying the text natively from a label in xamarin forms and it seems to be no straightforward way of implementing this.
My problem is that I need to present a large amount of data from a book in a label and the user should be able to select and copy a chunk of text from the label.
I moved on to present the data in an Editor component instead but then the user can edit the text in the Editor. Making the Editor component read-only doesn't solve the problem either.
Any suggestions would be greatly appreciated!

I recently faced the same business requirement. An Editor with Renderers customization on each platform was the solution for me.
In short, Android renderer leverages CustomSelectionActionModeCallback and CustomInsertionActionModeCallback properties of EditText to customize context menu for text selection and insertion, while iOS renderer is pretty straight-forward and sets Selectable and Editable properties of UITextView.
Check out my post with full code for Xamarin.Forms. You can also read posts on native Android and native iOS for more details.

I have the same requirement and I implemented CustomLabelRenderer for Android and iOS platform.

Related

Xamarin - support inserting GIF and images using Android keyboard

Has anyone gotten the android keyboard to support GIF and image insertion in an Xamarin app? Let's say I want to build a chat application, have a custom EditText view to capture user input, and want to have it behave similar to the Android built-in chat application. Currently the keyboard shows a popup . Is it possible to make this work? I prefer to not create a custom keyboard renderer, though was hoping this could be done within a custom EditText renderer. Along the lines of:
UPDATE: For anyone looking for a similar solution, I have been making progress using the https://github.com/xamarin/monodroid-samples/tree/main/android-n/CommitContentSample. Essentially set the content mime types and wrap the IOnCommitContentListener, then process OnCommitContent().

Xamarin Forms - Map CustomImagePin with text label right below

Hi StackOverflow Community.
I am struggling to add a text label along with a custom image pin in Xamarin forms custom map project.
Currently, i followed up the official Xamarin forms the documentation of how to implement custom pins on the map.
But want to extend a little more this functionality as showing also a label right below the pin is Critical for the application.
I wasn't lucky to find any custom solution for this
Could you please assist?
Below you can find the website solution I am using with google maps. Something like that needs to be created also for the Xamarin app

Custom Editor Xamarin Forms for handling rich text

I need to create a Editor that can handle the rich text and provide similar behavior showing in image in iOS, Android and UWP device.
Thanks
You can use syncfusion's rich text editor control.
https://help.syncfusion.com/xamarin/rich-text-editor/overview

Can I make a Xamarin.Form app (iOS) support Apple Dynamic Type?

In Apple iOS Settings > Display & Brightness there is the ability to change the size of text for applications that use Dynamic Type.
Is it possible to do this with Xamarin.Forms app (iOS custom rendere maybe). If so can someone give an example of how to do this for something like a TableSection Heading and a Label?
For iOS you need for XF TableView TableViewRenderer with native control of UITableView. More here:
https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/custom-renderer/renderers/
To avoid duplicated answer I will just provide a link
With a custom renderer can I make a TableSection.Title appear in small mixed case?

Xamarin - mixing Forms and Storyboards

Is it possible to mix iOS Storyboards and Xamarin Forms within one application? I have a bunch of views that are easier to be created in Forms, but some which are heavily customized so we would need to create some of them in native code.
I would like to use Storyboards to create the native parts, but can't seem to find a way to navigate from a Forms page to a Storyboard and vice versa.
I don't mind doing it from code, just need to know the direction to look into and if it's even possible.
You can create native views using the concept of Custom Renderers (see links below). The idea is that you create a Xamarin Forms Control that's shared between all platforms and which old common properties (like colors, general data etc), and do the native rendering on the iOS/Android/WP projects.
So, for your storyboard, you can create it usign Xamarin.iOS, and render using a Custom Renderer. The link posted by #GSerg in the comments have some information and examples, but you can take a closer look at the oficial documentation as well:
Introduction to Custom Renderers
Customizing Controls on Each Platform
Customizing Control Rendering in Xamarin.Forms (video)
Also, for more real world examples you can take a look at the Xamarin Forms XLabs project.
Thanks to Rafael Steil's answer. I looked at the links and a few more samples.
Notably:
Custom Renderer Map
Using Xamarin Forms alongside Storyboard
And I created a sample project to show the back-and-forth navigation between Xamarin Forms and pages created in Storyboards. You can find it over here:
Xamarin Forms Mixed with Native

Resources