コメント
コメントの投稿
※名前とタイトルが入力されていないコメントでは他のコメントとの区別ができません。
入力されていないコメントには返信しませんのであらかじめご了承くださいませ。
<ContentPage.Content>
<StackLayout x:Name="baseLayout"
Orientation="Vertical"
VerticalOptions="FillAndExpand"
Spacing="15">
<ScrollView x:Name="scrollLayout"
Orientation = "Vertical"
VerticalOptions="FillAndExpand">
<RelativeLayout
VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand">
<StackLayout x:Name="mainLayout"
VerticalOptions="FillAndExpand"
Orientation="Vertical">
<StackLayout.Padding>
<OnPlatform x:TypeArguments="Thickness"
iOS="10, 10, 10, 0"
Android="10, 10, 10, 0"
WinPhone="10, 10, 10, 0" />
</StackLayout.Padding>
<!--ここにラベルやSwitch、Picker、Entry等のコンテンツを配置します。-->
</StackLayout>
<ContentView x:Name="cvLayer"
BackgroundColor="Orange"
Opacity="0.8"
IsVisible="False"
VerticalOptions="Center"
HorizontalOptions="Center"
RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,
Property=Width,
Factor=0.25}"
RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,
Property=Height,
Factor=0.4}"
>
<Frame x:Name="frLayer"
BackgroundColor="White"
IsVisible="False">
<StackLayout>
<ActivityIndicator x:Name="Indicator"
IsRunning="False">
<ActivityIndicator.Color>
<OnPlatform x:TypeArguments="Color"
iOS="Orange"
Android="Orange"
WinPhone="Accent" />
</ActivityIndicator.Color>
</ActivityIndicator>
<app:CFLabel Text="Data loading..."
TextColor="Black"
XAlign="Center" />
</StackLayout>
</Frame>
</ContentView>
</RelativeLayout>
</ScrollView>
</StackLayout>
</ContentPage.Content>
using Xamarin.Forms;
public partial class TestPage : ContentPage
{
async void OnButtonClick(object sender, EventArgs e)
{
try
{
cvLayer.IsVisible = true;
frLayer.IsVisible = true;
Indicator.IsRunning = true;
await Task.Run(() =>
{
//長い処理を記述
});
}
finally
{
Indicator.IsRunning = false;
frLayer.IsVisible = false;
cvLayer.IsVisible = false;
}
}
}
※名前とタイトルが入力されていないコメントでは他のコメントとの区別ができません。
入力されていないコメントには返信しませんのであらかじめご了承くださいませ。