标签不在Frame内显示文本

问题描述 投票:1回答:1

我正在开发Xamarin.Forms中的跨平台应用程序。我使用了框架,标签和按钮控制。按钮显示完美,但标签不显示框架内的文本。

屏幕截图是

Screenshot of the screen

我还想将按钮更改为圆角。怎么可能?

如何更改底部导航栏颜色和textColor?

我正在使用BottomNavigationBar.XF插件。

我的代码是:

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         x:Class="DhirenBhai_sApp.Views.StoresPage" Title="Stores">
<ContentPage.Content>
    <StackLayout>
        <StackLayout VerticalOptions="Start" BackgroundColor="LawnGreen" HeightRequest="40">
            <Label Text="Stores" TextColor="White" VerticalOptions="Center" HorizontalOptions="Center" FontSize="Large" />
        </StackLayout>
        <Frame VerticalOptions="FillAndExpand" Margin="10" BackgroundColor="Transparent" Padding="5" >
            <Label TextColor="Black" HorizontalOptions="CenterAndExpand" Text="Stores" />
            <Label TextColor="Black" HorizontalOptions="CenterAndExpand" Text="You don't have to worry about your money being stolen from online attacks." ></Label>
            <Label TextColor="Black" HorizontalOptions="CenterAndExpand" Text="You now have the option to save your money offline, by your using a device."></Label>
            <Label TextColor="Black" HorizontalOptions="CenterAndExpand" Text="Register and find out more about the offline storage device from service provider"></Label>
            <Button Text="Register" BackgroundColor="LawnGreen" Margin="5"  BorderWidth="50" TextColor="White" VerticalOptions="End" ></Button>
        </Frame>
    </StackLayout>
</ContentPage.Content>

c# xamarin xamarin.forms frame
1个回答
2
投票

试试下面的代码

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
 x:Class="DhirenBhai_sApp.Views.StoresPage" Title="Stores">
<ContentPage.Content>
    <StackLayout>
        <StackLayout VerticalOptions="Start" BackgroundColor="LawnGreen" HeightRequest="40">
            <Label Text="Stores" TextColor="White" VerticalOptions="Center" HorizontalOptions="Center" FontSize="Large" />
        </StackLayout>
        <Frame VerticalOptions="FillAndExpand" Margin="10" BackgroundColor="Transparent" Padding="5" >
            <StackLayout VerticalOptions="FillAndExpand">
                <Label TextColor="Black" HorizontalOptions="CenterAndExpand" Text="Stores" />
                <Label TextColor="Black" HorizontalOptions="CenterAndExpand" Text="You don't have to worry about your money being stolen from online attacks." ></Label>
                <Label TextColor="Black" HorizontalOptions="CenterAndExpand" Text="You now have the option to save your money offline, by your using a device."></Label>
                <Label TextColor="Black" HorizontalOptions="CenterAndExpand" Text="Register and find out more about the offline storage device from service provider"></Label>
                <Button Text="Register" BackgroundColor="LawnGreen" Margin="5"  BorderWidth="50" TextColor="White" VerticalOptions="End" ></Button>
            </StackLayout>
        </Frame>
    </StackLayout>
</ContentPage.Content>

注意: - 框架只包含一个子项,这就是为什么必须采用另一种布局来包含所有标签和按钮的原因

© www.soinside.com 2019 - 2024. All rights reserved.