question

MH-7792 avatar image
0 Votes"
MH-7792 asked RobCaplan edited

Place View on top of canvas

I'm writing a Xamarin Forms app, and am currenly trying to draw something on top of the tabpage toolbar.

Using a custom renderer for Android and overriding the methhod DispatchDraw I was able to draw simple objects on top of the canvas, but how can I do this with Views, or even custom layouts defined in the Resources?


Any help is greatly appreciated.


dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

JarvanZhang-MSFT avatar image
0 Votes"
JarvanZhang-MSFT answered JarvanZhang-MSFT commented

Hello,​

Welcome to our Microsoft Q&A platform!

TabbedPage uses the native look and feel, the native platforms may limit the custom design. Xamarin Community Toolkit provides the TabView control to customize the tab bar, it supports animations, badges, and most of all functions. Try using TabView to create the style.

For more details, please check:
https://devblogs.microsoft.com/xamarin/xamarin-community-toolkit-tabview/
https://docs.microsoft.com/en-us/xamarin/community-toolkit/views/tabview

Best Regards,

Jarvan Zhang



If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello, thank you very much for you answer.
But I'm using ReactiveUI for my app, with the ReactiveTabbedPage, which I would like to keep.

Because of that, I would probably need a platform specific implementation with an TabbedPageRenderer.


0 Votes 0 ·

To display the views on the top of the toolbar, try to wrap the TabbedPage within the navigation page. Then use NavigationPage.TitleView to display the views you want.

0 Votes 0 ·

The official Microsoft documentation about the TabbedPage contains a warning, that you should not put the TabbedPage inside a NavigationPage.
Docs


0 Votes 0 ·
Show more comments