コメント
コメントの投稿
※名前とタイトルが入力されていないコメントでは他のコメントとの区別ができません。
入力されていないコメントには返信しませんのであらかじめご了承くださいませ。
<BoxView x:Name="line1" />
public SamplePage() : ContentPage
{
InitializeComponent();
line1.HeightRequest = 1;
line1.WidthRequest = 100;
switch (Device.OS)
{
case TargetPlatform.iOS:
line1.BackgroundColor = Color.Black;
break;
case TargetPlatform.Android:
line1.BackgroundColor = Color.White;
break;
default:
line1.BackgroundColor = Color.White;
break;
}
}
using Xamarin.Forms;
namespace AppName.Controls
{
[System.Diagnostics.DebuggerStepThrough()]
public class BaseLine : BoxView
{
public BaseLine() : base()
{
this.HeightRequest = 1;
this.WidthRequest = 100;
this.BackgroundColor = Color.Gray;
this.Margin = new Thickness(0, 10, 0, 10);
}
public Color LineColor {
get { return this.BackgroundColor; }
set { this.BackgroundColor = value; }
}
}
}
<ContentPage xmlns:base="clr-namespace:AppName.Controls;assembly=AppName">
<base:BaseLine x:Name="line1" />
</ContentPage>
※名前とタイトルが入力されていないコメントでは他のコメントとの区別ができません。
入力されていないコメントには返信しませんのであらかじめご了承くださいませ。