-1
私のアクティビティには四角形のボタンがあります。私は円の形に変更する必要があります。 XAMLを使用してこれをどのように達成できますか?xamlを使用してボタンの形状を四角形からサークルに変更するには
私のアクティビティには四角形のボタンがあります。私は円の形に変更する必要があります。 XAMLを使用してこれをどのように達成できますか?xamlを使用してボタンの形状を四角形からサークルに変更するには
私はこれがIOSのcornerradiusでのみ可能だと思いますが、PCLやxamlを使った他のXamarinソリューションではこれが可能ではないと思います。おそらく、カスタムレンダラーを作成する必要があります。
私は通常
var box = new ShapeView
{
ShapeType = ShapeType.Box,
HeightRequest = 75,
WidthRequest = 75,
Color = Color.Navy,
HorizontalOptions = LayoutOptions.Center,
CornerRadius = 5,
BorderColor = Color.Red,
BorderWidth = 1f,
Content = new Label
{
Text = "Touch me!",
FontSize = Device.GetNamedSize(NamedSize.Micro, typeof (Label)),
TextColor = Color.White,
HorizontalOptions = LayoutOptions.Fill,
VerticalOptions = LayoutOptions.Fill,
VerticalTextAlignment = TextAlignment.Center,
HorizontalTextAlignment = TextAlignment.Center,
},
};
var tap = new TapGestureRecognizer
{
Command = new Command(() => {
this.DisplayAlert("Touched", "This shape responds to touch!", "Ok");
})
};
box.GestureRecognizers.Add(tap);
この
enter link description here 変更形状タイプを使用します