我想在UIBarButtonItem
我在按钮的操作上编写了以下代码。
-(IBAction)showAvailableCategory:(UIButton *)sender
{
CategoryPopup *categoryPopupViewController = [[CategoryPopup alloc]init];
UIPopoverPresentationController *popOverCat = categoryPopupViewController.popoverPresentationController;
categoryPopupViewController.preferredContentSize = CGSizeMake(138, 122);
popOverCat.delegate = self;
popOverCat.sourceView = sender;
popOverCat.sourceRect = sender.bounds;
popOverCat.permittedArrowDirections = UIPopoverArrowDirectionAny;
[self presentViewController:categoryPopupViewController animated:YES completion:nil];
}
我已在CategoryPopup
中将xib
设为自由格式,并且我正在实施以下委托方法
-(UIModalPresentationStyle) adaptivePresentationStyleForPresentationController: (UIPresentationController * ) controller
{
return UIModalPresentationNone;
}
但是它没有弹出窗口,而是全屏,是否有解决方法?
答案 0 :(得分:0)
您忘记了一个设置,在String manufacturer = "xiaomi";
if(manufacturer.equalsIgnoreCase(android.os.Build.MANUFACTURER)) {
//this will open auto start screen where user can enable permission for your app
Intent intent = new Intent();
intent.setComponent(new ComponentName("com.miui.securitycenter", "com.miui.permcenter.autostart.AutoStartManagementActivity"));
startActivity(intent);
}
初始化后立即添加:
categoryPopupViewController