gpt4 book ai didi

c# - 标签不在框架内显示文本

转载 作者:太空宇宙 更新时间:2023-11-03 22:49:08 25 4
gpt4 key购买 nike

我正在 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>

最佳答案

试试下面的代码

<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>


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

关于c# - 标签不在框架内显示文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48369987/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com