在底部的xamarin iOS上显示UIAlertController

时间:2018-08-22 14:41:09

标签: c# xamarin xamarin.ios

我需要在iOS屏幕底部显示警报,因为它现在显示在屏幕中间。警报,几秒钟后我将被解雇。

下面我正在使用的代码

                         int oldWidth = bitmap.getWidth();
                        int oldHeight = bitmap.getHeight();
                        double aspectRatio = ((double) oldWidth / (double) oldHeight);
                        DisplayMetrics display = mContext.getResources().getDisplayMetrics();
                        int width = (int) ((display.widthPixels) * 0.6);
                        int height = (int) (width / aspectRatio);
                        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(width, height);
                        Imageview.setLayoutParams(layoutParams);

我如何使其位置最底端?

1 个答案:

答案 0 :(得分:1)

  

在iOS屏幕底部显示的警报

您要使用“ ActionSheet”样式

var alert = UIAlertController.Create("StackOverflow", "Rocks", UIAlertControllerStyle.ActionSheet);

Apple Docs:https://developer.apple.com/design/human-interface-guidelines/ios/views/action-sheets/

enter image description here