gpt4 book ai didi

c# - 相对布局上的背景图像无法获取表单上的屏幕尺寸

转载 作者:行者123 更新时间:2023-11-29 02:12:33 26 4
gpt4 key购买 nike

这是来自标签页的图像和布局的代码:

RelativeLayout PrincipalLayout = new RelativeLayout ();

Image background = new Image {
Source = Images.Background,
};

PrincipalLayout.Children.Add (background,
xConstraint: Constraint.RelativeToParent ((parent) => {
return 0;
}),
yConstraint: Constraint.RelativeToParent ((parent) => {
return 0;
}),
widthConstraint: Constraint.RelativeToParent ((parent) => {
return parent.Width;
}),
heightConstraint: Constraint.RelativeToParent ((parent) => {
return parent.Height;
})
);
this.Content = PrincipalLayout;

但是图像不是从 X = 0 开始,也不是在正确的位置结束。

看图:

http://i292.photobucket.com/albums/mm15/romuloviel/Captura%20de%20Tela%202015-03-18%20as%2010.06.34_zpsb4cquhtd.png

我需要图像获取所有帧。

最佳答案

Image 对象的默认方面是 AspectFit - 这可能会导致一些字母装箱。

有关可以更好地显示图像的其他方面,请参阅文档:

http://iosapi.xamarin.com/?link=T%3aXamarin.Forms.Aspect

关于c# - 相对布局上的背景图像无法获取表单上的屏幕尺寸,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29123984/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com