Forum Xamarin.iOS

Using pictures

awerberawerber Member ✭✭✭

I created a tabbed document project in Visual Studio 2019 Community Edition for Windows. I got the following XAML file as the startup page:

<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
            xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
            xmlns:views="clr-namespace:RodnwyPix.Views"
            xmlns:rodneypix="clr-namespace:RodneyPix"
            x:Class="RodnwyPix.Views.MainPage">
    <TabbedPage.Children>
        <NavigationPage Title="Pictures">
            <NavigationPage.Icon>
                <OnPlatform x:TypeArguments="FileImageSource">
                    <On Platform="iOS" Value="tab_feed.png"/>
                </OnPlatform>
            </NavigationPage.Icon>
            <x:Arguments>
                <rodneypix:PictureDirectories />
            </x:Arguments>
        </NavigationPage>

        <NavigationPage Title="Video">
            <NavigationPage.Icon>
                <OnPlatform x:TypeArguments="FileImageSource">
                    <On Platform="iOS" Value="tab_about.png"/>
                </OnPlatform>
            </NavigationPage.Icon>
            <x:Arguments>
                <rodneypix:Video />
            </x:Arguments>
        </NavigationPage>
    </TabbedPage.Children>
</TabbedPage>

As you can see, there are two images in that code. The images looked like I expected when I ran my project in the Simulator. I replaced those images (meaning I created some images and renamed them using the names above) with images I wanted. The resolution of my images are the same as the images generated by Visual Studio. But, all I see now is a blue and and orange square where the images go.

How do I fix this to use the images I want?

Thanks for any help.

Also, while on the subject of images, how do I make an image to use as a splash screen?

Best Answer

Answers

  • awerberawerber Member ✭✭✭

    @LandLu, thank you again for taking your time to answer my question. I decided to make an image that will work rather than use your code to use a bitmap image. It made more sense than using the image I planned on using.

    I will mark your comment as the answer, even though I have not tested the code.

Sign In or Register to comment.