RTF (HTML) Text Box

Any way to place an html text box in the SfImageViewer? I have text containing HTML which I would like to display on-screen in the image viewer. Using the default text box obviously I end up displaying the html itself. I'm hoping you have a trick for it, or else I'd like this to be considered a feat


5 Replies

JC Jonah Coleman July 10, 2021 11:32 PM UTC

I haven't been able to get something like this to work:


var webView = new WebView() { WidthRequest = 100, HeightRequest = 100 };

webView.Source = new HtmlWebViewSource() { Html = @"<span style=""color:blue"";font-size:16px;>TEST</span>" };

imageEditor.AddCustomView(webView, new CustomViewSettings() { Bounds = new Rectangle(25, 25, 50, 50), Angle = 0 });




SS Sridevi Sivakumar Syncfusion Team July 12, 2021 12:43 PM UTC

Hi Jonah Coleman,

Greetings from Syncfusion.

We have analysed your requirement and we have loaded the webview  as a customview of SfImageEditor as per below code snippet


[MainPage.xaml]:
 
            <imageeditor:SfImageEditor Source="{Binding Image}"   x:Name="imageEditor" ImageLoaded="imageEditor_ImageLoaded" /> 

[MainPage.cs]: 
        private void imageEditor_ImageLoaded(object sender, ImageLoadedEventArgs args) 
        { 
            var webView = new WebView() { WidthRequest = 100, HeightRequest = 100 }; 
            webView.Source = new HtmlWebViewSource() { Html = @"<span style=""color:blue"";font-size:16px;>TEST</span>" }; 
            imageEditor.AddCustomView(webView, new CustomViewSettings() { Bounds = new Rectangle(25, 25, 50, 50), Angle = 0 }); 
        } 

NoteWebView is added properly in Android and UWP platform and it text not loaded in the iOS platform , currently we are checking the reported problem and we will update the details on July 14,2021.

Regards,
 
Sridevi S. 
 



JC Jonah Coleman July 12, 2021 01:48 PM UTC

Ah, I was testing in iOS at the time so that explains why I could see it.  Thank you for looking at this.



SS Sridevi Sivakumar Syncfusion Team July 13, 2021 01:55 PM UTC

Hi Jonah Coleman,

We have validated the reported issue “[iOS] Custom view is not displaying when converting WebView content to native view” and we have logged a bug report for this issue. You can keep track of the bug from the feedback portal below.

Link: https://www.syncfusion.com/feedback/26978  

The provided feedback link is private, and you need to login to view this feedback.

We will include the fix in the next weekly NuGet which is expected to be released on July 20, 2021.

If you have any more specification/precise replication procedure or a scenario to be tested, you can add it as a comment in the portal.

Regards, 
Sridevi S.    
 



SS Sridevi Sivakumar Syncfusion Team July 20, 2021 09:35 AM UTC

Hi Jonah Coleman,

We have fixed the “
[iOS] Custom view is not displaying when converting WebView content to native view” issue and the fix is included in our weekly NuGet of July 20, 2021.

NuGet Version: 19.2.0.48

We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.

Regards,
Sridevi S. 


Loader.
Up arrow icon