在xamarin表单中创建自定义框架

在xamarin表单中创建自定义框架,xamarin,xamarin.forms,custom-controls,frame,Xamarin,Xamarin.forms,Custom Controls,Frame,我必须创建一个框架,如附件中的照片,问题是它必须是可适应的,因为它将包含标签/文本,而且它应该有海拔和阴影。 所有这一切都是很容易做到的一个框架,问题是小言语的东西,我找不到一个方法,使它 也许有人有个想法。 谢谢您可以将框架的高度和宽度与其子元素(如标签)绑定 暗藏 在xaml中 谢谢您的回答,但问题是如何使用框架中小箭头的ui。您似乎想创建聊天框架?是的,看起来您可以使用nuget的第三方库。如果你自己实现的话会有点复杂。你有什么例子吗? public class SizeConverte

我必须创建一个框架,如附件中的照片,问题是它必须是可适应的,因为它将包含标签/文本,而且它应该有海拔和阴影。 所有这一切都是很容易做到的一个框架,问题是小言语的东西,我找不到一个方法,使它

也许有人有个想法。
谢谢

您可以将框架的高度宽度与其子元素(如标签)绑定

暗藏 在xaml中


谢谢您的回答,但问题是如何使用框架中小箭头的ui。您似乎想创建聊天框架?是的,看起来您可以使用nuget的第三方库。如果你自己实现的话会有点复杂。你有什么例子吗?
public class SizeConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        return ((double)value + 20.0); // you can set the logic of height and width here  
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        return 0;
    }
}
<ContentPage.Resources>
    <ResourceDictionary>
        <local:SizeConverter x:Key="SizeConverter" />
    </ResourceDictionary>
</ContentPage.Resources>

<StackLayout VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
    <Frame CornerRadius="10" WidthRequest="{Binding Source={x:Reference contentLabel}, Path=Width,Converter={StaticResource SizeConverter} ,Mode=OneWay}" MinimumHeightRequest="100" HeightRequest="{Binding Source={x:Reference contentLabel}, Path=Height,Converter={StaticResource SizeConverter} ,Mode=OneWay}" BackgroundColor="LightBlue" Padding="10" >
        <!-- Place new controls here -->
        <Label x:Name="contentLabel"  BackgroundColor="LightGray" Text="xxx" 
       HorizontalOptions="Center"
       VerticalOptions="CenterAndExpand" />
    </Frame>
</StackLayout>