Xamarin 如何在框架上设置标签或文本
我想在下图中做这个设计 问题是文本隐藏在框架下 我的密码是Xamarin 如何在框架上设置标签或文本,xamarin,xamarin.android,xamarin.ios,Xamarin,Xamarin.android,Xamarin.ios,我想在下图中做这个设计 问题是文本隐藏在框架下 我的密码是 <Frame Margin="40,20,40,-25" Parent="gggg" WidthRequest="60" HeightRequest="20" BackgroundColor="#E2F3F3" HasShadow="False" IsClippedToBounds="False" > <Label x:Name="liTitel2"
<Frame Margin="40,20,40,-25" Parent="gggg" WidthRequest="60" HeightRequest="20" BackgroundColor="#E2F3F3" HasShadow="False" IsClippedToBounds="False" >
<Label x:Name="liTitel2" FontSize="17" HorizontalOptions="CenterAndExpand" TextColor="#009896" Text="الإحصاءات"/>
</Frame>
<Frame BorderColor="#009896" BackgroundColor="Transparent" Margin="10,0,10,10" >
//Some Code
</Frame>
//一些代码
我使用了AbsoluteLayout和Grid,但仍然存在相同的问题如果您查看代码,答案会自动出现,您已将标签放在框架下方,只需将其放在上方:
<Frame BorderColor="#009896" BackgroundColor="Transparent" Margin="10,0,10,10" >
//Some Code
</Frame>
<Frame Margin="40,20,40,-25" Parent="gggg" WidthRequest="60" HeightRequest="20" BackgroundColor="#E2F3F3" HasShadow="False" IsClippedToBounds="False" >
<Label x:Name="liTitel2" FontSize="17" HorizontalOptions="CenterAndExpand" TextColor="#009896" Text="الإحصاءات"/>
</Frame>
//一些代码
请仔细阅读下面的代码,希望对您有所帮助
<Grid VerticalOptions="Center" Padding="1" Margin="15">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Frame Grid.Row="0" CornerRadius="10" BorderColor="Red" HasShadow="False" Padding="10,20">
<BoxView HeightRequest="150">
</BoxView>
</Frame>
<StackLayout Grid.Row="0" HorizontalOptions="Center" VerticalOptions="Start" TranslationY="-10" Padding="10,0" BackgroundColor="White">
<Label Text="Sample Text" VerticalOptions="Center" VerticalTextAlignment="Center"/>
</StackLayout>
</Grid>
输出:
我使用AbsoluteLayout制作了一个示例,您可以查看一下:
<AbsoluteLayout
x:Name="ViewControls"
Margin="10,10,10,10"
BackgroundColor="#E2F3F3"
HeightRequest="300">
<Frame
Margin="20,20,20,20"
AbsoluteLayout.LayoutBounds="1,1,1,1"
AbsoluteLayout.LayoutFlags="All"
BackgroundColor="Transparent"
BorderColor="#009896">
<!--<Grid Margin="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label
Grid.Column="0"
BackgroundColor="White"
HorizontalTextAlignment="Center"
Text="Left" />
<Label
Grid.Column="2"
BackgroundColor="White"
HorizontalTextAlignment="Center"
Text="Right" />
<Label
Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="3"
BackgroundColor="White"
HorizontalTextAlignment="Center"
Text="Across Page" />
</Grid>-->
</Frame>
<Frame
Padding="2"
AbsoluteLayout.LayoutBounds=".5,0,100,50"
AbsoluteLayout.LayoutFlags="PositionProportional"
BackgroundColor="#E2F3F3"
BorderColor="Transparent">
<Label
x:Name="liTitel2"
FontSize="17"
HorizontalOptions="CenterAndExpand"
Text="الإحصاءات"
TextColor="#009896" />
</Frame>
</AbsoluteLayout>
@YanalAboHadhod如果我的回复对您有帮助,您能将我的回复标记为答案以关闭您的帖子吗?谢谢