Closed johnmangam closed 3 years ago
Hi @johnmangam , can you set breakpoints in your code and see if they are hit? Also, I don't recall exactly how it works, but how are you using MyShellRenderer
in the app? It seems you've registered it as the renderer for SomeApp.AppShell
, but then how are you using that in your app?
Hi @Eilon Thank you for your message. Since I have registered as a renderer, I assumed it would be picked up dynamically, sorry. I see that it is not currently hit. Am I missing a step here, please?
I'm not an expert on this area, but I think the renderer needs to be associated with a control that's in the app. There is Xamarin.Forms.Shell in your app (presumably) wherever you use the <Shell ... />
element, but I don't know if you're using SomeApp.AppShell
.
You might need to just remove your type SomeApp.AppShell
and change the ExportRenderer
attribute to associate Xamarin.Forms.Shell
with your renderer?
Oh wait I misunderstood something, hold on... I didn't realize that AppShell is the shell of your app. Let me think about this...
Ah OK, so in your app I'm guessing that AppShell
comes from AppShell.razor
, which is just a Razor component. But the concept of a "renderer" is a Xamarin.Forms thing. So for custom renderers you need to associate the Xamarin.Forms element with your custom renderer. So maybe try this instead:
[assembly: ExportRenderer(typeof(Xamarin.Forms.Shell), typeof(SomeApp.Droid.MyShellRenderer))]
And cross your fingers 😄
Thank you so much @Eilon it hits the breakpoint now.
Hats off to you and your team for MBB. A simple developer like me is able to send apps to the store easily. Thank you so much.
Though it hits the breakpoint in myshellrenderer, it doesn't change the color of the top bar as shown in the picture. Any help would be great, thank you.
Hmm I'm not familiar with the Android-specific behavior here. Perhaps your code is running, but something else is overwriting the color? Are there other methods/events you can hook to try to detect that?
Thank you @Eilon I will try and let you know. Thanks again.
I was able to make changes to navbar colors using ShellProperties:
<ContentPage Title="cp title">
<ShellProperties
BackgroundColor="XF.Color.Red"
NavBarIsVisible="true"
TitleColor="XF.Color.Yellow" />
Thank you once again @Eilon for your time.
I'm using 0.6.69-preview version of MBB
Somehow it looks like it ignores for there is no color change in my GUI, please help as I am trying to change the colors of tabbar.
AppShell.razor
Tabbar.xml
Colors.xml
Styles.xml