Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

First Forms App - actionbar question

$
0
0

I have a successful android app developed in native xamarin android. Now i'm trying to port it to forms. I'm going the xaml approach. I've gone through the documentation and looked at several samples.

I've created a hello world app and added a toolbar item the contentPage. When I initially start the app, the action bar is visible with my icon, the normal teal background and there is a nice horizontal line. However, once my forms code kicks in, it displays my icon, my toolbaritem icon, but the background is black and there is no horizontal line.

How do I change the color of the actionbar and get the horizontal line back? I've tried NavigationPage.BackgroundColor and that had no affect. I'm thinking i'm doing something small wrong.

Here is my xaml.

<?xml version="1.0" encoding="utf-8" ?>

<ContentPage.Title>
My Sample
</ContentPage.Title>

<ContentPage.ToolbarItems>

</ContentPage.ToolbarItems>

Here is my app.cs
public class App
{
public static Page GetMainPage()
{
var nav = new NavigationPage(new Splash());
nav.BackgroundColor = Color.Teal;
return nav;
}
}

I'd also like to hide the default actionbar at startup and go with a full splash screen, but I did find this thread that looks like it'll work.
http://forums.xamarin.com/discussion/18290/hiding-the-status-bar-and-the-action-bar-in-android-app

-Randy


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>