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

Fullscreen CarouselPage with background image and overlayed scrollable text

$
0
0

Hi guys, I'm trying to get a Xamarin Forms CarouselPage based app working, but I'm not sure if what I'm trying to do is actually possible, I've run into a couple difficulties.

So far I can get the carousel working with the code shown below. I can then swipe between each image and this behaves as expected.

    public class App
    {
        public static Page GetMainPage()
        {
            return new CarouselPage {
                  Children = {
                    new ContentPage {Content = new Image {Source = "image1.png"}},
                    new ContentPage {Content = new Image {Source = "image2.png"}},
                    new ContentPage {Content = new Image {Source = "image3.png"}},
                  }
            };
        }
    }

What I'd like to do next is have the image completely fullscreen (and landscape), the images are the correct size so will fill the screen correctly.

The following code works as expected on another app I have that is android only and NOT using Xamarin Forms:

[Activity(Label = "MyApp1", MainLauncher = true, Icon = "@drawable/icon", ScreenOrientation = Android.Content.PM.ScreenOrientation.Landscape, Theme = "@android:style/Theme.NoTitleBar.Fullscreen")]

When I try this in the MainActivity for my app using Xamarin Forms, there's a nullpointer exception and the carousel page isn't displayed correctly, I can hide the action bar using

ActionBar.Hide();

but this only gets me half way as the title bar is hidden but I can still see the status bar with the Wi-Fi/battery icons.

Is there something I need to code in my App.cs file to achieve this rather than the MainActivty?

The next thing I wasn't sure about is how I would then overlay some scrollable text on top of each of the images, that changes after each swipe. It'd be perfect if the overlayed text had a transparent background so you could still see the image behind.

Any ideas?

Thanks


Viewing all articles
Browse latest Browse all 58056

Trending Articles