在OnSizeAllocated之后-Xamarin表单

时间:2018-09-12 08:28:01

标签: xamarin.forms

我想获取放置在xaml中的控件的宽度和高度,我们将在OnSizeAllocated事件期间请求高度和宽度,是否有任何事件会在OnSizeAllocated之后触发?这样我可以获得控件的确切高度和宽度吗?

 protected override void OnSizeAllocated(double width, double height)
    {
        base.OnSizeAllocated(width, height);
        SelectedSideImage.WidthRequest = width - (width * 10 / 100);
        SelectedSideImage.HeightRequest = height - (height * 50 / 100); 
    }

0 个答案:

没有答案