は、私は自分のページを作成するには、このコードを持っていますが、何らかの理由で画像OSがページ全体を取り、他のコンテンツ のいずれかが表示されないここで私は取得しています何の絵があります。画像は、デフォルトTEXTCOLORはあなたの背景色の見えないような黒であるのでstacklayout画面全体が追い越されていますか?
namespace GarageSale.Views
{
public class abcChapterPage : basePage
{
myDataTypes.abcChapter abc;
StackLayout baseStack;
#region Views
Label lblName = new Label
{
Text = "",
VerticalOptions = LayoutOptions.StartAndExpand,
HorizontalOptions = LayoutOptions.CenterAndExpand
};
Label lblSchool = new Label
{
Text = "",
VerticalOptions = LayoutOptions.StartAndExpand,
HorizontalOptions = LayoutOptions.CenterAndExpand
};
Label lblLocation = new Label
{
Text = "",
VerticalOptions = LayoutOptions.CenterAndExpand,
HorizontalOptions = LayoutOptions.CenterAndExpand
};
Image profImg = new Image
{
Scale = .1f,
Aspect = Aspect.AspectFit,
};
Button viewItems = new Button
{
Text = " View Items ",
BorderRadius = 0,
//Margin = 0,
HorizontalOptions = LayoutOptions.FillAndExpand,
};
Button viewMembers = new Button
{
Text = "View Members",
BorderRadius = 0,
//Margin = 0,
HorizontalOptions = LayoutOptions.FillAndExpand,
};
#endregion
public abcChapterPage(myDataTypes.abcChapter o)
{
abc = o;
populateProfileFields();
}
public abcChapterPage()
{
shouldGetChapter = true;
abcid = int.Parse(App.CredManager.GetAccountValue("abc_chapter_id"));
}
StackLayout makeGUI()
{
viewItems.Command = new Command(() =>
{
Navigation.PushAsync(new viewListPage(new itemListView(), abc.id, 1, "Items for sale by " + abc.school));
});
viewMembers.Command = new Command(() =>
{
Navigation.PushAsync(new viewListPage(new userListView(), abc.id, 2, " abc Members " + abc.school));
});
#region basestack
return new StackLayout
{
VerticalOptions = LayoutOptions.Fill,
HorizontalOptions = LayoutOptions.Fill,
Children = {
//lblName,
profImg,
lblSchool,
lblLocation,
new StackLayout {
Orientation = StackOrientation.Horizontal,
Padding = 0,
// Margin = 0,
Spacing = 0,
Children = {
viewItems,
viewMembers
}
}
}
};
#endregion
}
public void populateProfileFields()
{
baseStack = makeGUI();
Title = abc.school + " abc";
lblSchool.Text = abc.school;
lblLocation.Text = abc.city +", "+ abc.state;
profImg.Source = ImageSource.FromStream(() => new MemoryStream(abc.picture));
Content = baseStack;
//TODO: do this if user is admin
//if (Constants.AdminUsers.Contains(App.CredManager.GetAccountValue("G_id")) && !adminAlert)
//{
// await Task.Delay(5000);
// DisplayAlert("Admin Notice:", "You are logged in as an administrative user!", "Dismiss");
// adminAlert = true;
//}
}
bool shouldGetChapter = false;
int abcid;
protected async override void OnAppearing()
{
if (shouldGetChapter)
{
abc = await App.MANAGER.YSSI.GetabcChapter(abcid);
populateProfileFields();
}
}
}
使用XAMLと利用できるXAMLのプレビューアツールであなたの人生を容易にします – BraveHeart