我正在使用动态单元格高度的自动布局方法,如在UITableView 中使用自动布局实现动态单元格布局和可变行高中所述。到目前为止这有效。现在我正在展示我的UITableView一个UIPopoverController也有效的方法。现在到有趣的部分:我从不同的视图控制器呈现这个弹出窗口。在第一个视图控制器上,一切都按预期工作。如果我切换到第二个视图控制器(它也提供此弹出窗口),则弹出窗口完全为空(即使没有分隔线!),并且出现以下错误:
Unable to simultaneously satisfy constraints.
    Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
(
    "<NSLayoutConstraint:0x7a706fa0 H:|-(8)-[UILabel:0x7a707760] …uitableview uipopovercontroller autoresizingmask autolayout ios7
我知道以前有人问过这个问题,我已经检查了答案,但仍然有问题。我需要更新我的 XCODE 游戏,它是用 Objective-C 编写的,以便将它保存在 AppStore 中,而且我已经好几年没有主动接触 OBC 了。我已经能够解决除 UIPopoverController 问题之外的所有其他问题。
我在代码中用“>”标记了警告。
我真的很感激这里的一些帮助。
我有以下代码:
#import "DetailViewController.h"
@interface DetailViewController ()
>>@property (strong, nonatomic) UIPopoverController *masterPopoverController;
- (void)configureView;
@end
@implementation DetailViewController
@synthesize detailItem = _detailItem;
@synthesize detailDescriptionLabel = _detailDescriptionLabel;
>>@synthesize masterPopoverController = _masterPopoverController;
#pragma mark - Managing the detail item
- (void)setDetailItem:(id)newDetailItem
{
if (_detailItem != newDetailItem) {
    _detailItem = newDetailItem;
    // Update the view.
    [self configureView];
}
>>if (self.masterPopoverController != nil) {
>>    [self.masterPopoverController dismissPopoverAnimated:YES];
>>}        
}
- (void)configureView
{
// …我见过一些使用UIPopoverController的演示,并希望在我的应用程序中使用它.
那么有没有人有任何你可以链接我的好教程?
是否可以在UISegmentedControl中使用它,当选择不同的段作为交换机视图功能的类型时,会召唤不同的弹出窗口?
如何创建一个弹出框并用tableview填充它?我在视图底部的工具栏上有一个按钮,当我按下此按钮时,我想显示此弹出窗口
我只想更改按钮的iPad分割视图应用程序中的标题,该按钮以纵向模式启动Popover(显示主视图).我不能,为了我的生活,弄清楚如何引用这个按钮.我通过使用主详细信息应用程序模板(iOS 5和故事板)创建新项目来启动应用程序,并且大多数界面代码都在storyboard文件中开始.任何帮助表示赞赏.
在阅读了apple的示例:MultipleDetailViews演示如何使用UIPopOverController两个详细视图控制器之后,我无法弄清楚如何将自定义视图添加到委托方法中barButtonItem存在的视图splitViewController:
-(void)splitViewController:(UISplitViewController*)svc willHideViewController: (UIViewController *)aViewController withBarButtonItem:(UIBarButtonItem*)barButtonItem forPopoverController:(UIPopoverController*)pc {
    self.popoverController = pc;
    barButtonItem.text = @"root view controller";
    self.rootPopoverButtonItem = barButtonItem;
    UIViewController <SubstitutableDetailViewController> *detailViewController = [mySplitViewController.viewControllers objectAtIndex:0];
    [detailViewController showRootPopoverButtonItem:self.rootPopoverButtonItem];
}
弹出按钮与其默认形状配合良好,但当我尝试这样的事情时:
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
UIImage *customImage = [UIImage imageNamed:@"popOver.png"];
[button setBackgroundImage: [UIImage imageNamed:@"popOver.png"] forState:UIControlStateNormal];
button.frame= CGRectMake(0.0, 0.0, customImage.size.width, customImage.size.height);
[button addTarget:self action:@selector(???) forControlEvents:UIControlEventTouchUpInside];
barButtonItem.customView = button;
我不知道这个按钮的选择器会使弹出窗口正确显示,我的弹出窗口很好,没有使用委托方法UISplitViewController的选择器,所以我应该放在什么样的选择器?
我目前正在开发一个应用程序,它需要一个使用多种服务"共享"的选项; 比如电子邮件,推特.
为此,我有一个UIBarButtonItem编码输入,当触摸时,它会触发:
UIActionSheet *sheet = [[UIActionSheet alloc] 
                            initWithTitle:@""
                            delegate:self
                            cancelButtonTitle:nil
                            destructiveButtonTitle:nil
                            otherButtonTitles:nil];
    [sheet addButtonWithTitle:@"Email"];
    [sheet addButtonWithTitle:@"Tweet"];
    [sheet addButtonWithTitle:@"Cancel"];
    sheet.cancelButtonIndex = sheet.numberOfButtons-1;
    [sheet showFromRect:self.view.bounds inView:self.view animated:YES];
    [sheet release];
与此相结合以检测选择了哪个按钮:
clickedButtonAtIndex:(NSInteger)buttonIndex {
    if (buttonIndex == actionSheet.cancelButtonIndex) { return; }
    switch (buttonIndex) {
        case 0:
        {
            [self emailThis];
            break;
        }
        case 1:
        {
            [self tweetThis];
            break;
        }
    }
这适用于iPhone.但不幸的是它在iPad上显示不正确.看起来它正在尝试显示UIPopoverController,但它位于导航栏的中心,几乎没有高度.
我已经研究过使用UIPopoverController,但我似乎无法找到如何将它与按钮一起使用.无论如何我可以调整上面的代码来正确显示按钮,因为它已经尝试了.
非常感谢,
瑞安
PS:我是Objective-c/iOS编码的新手,所以请具体说明.谢谢 :)
编辑: 我尝试过使用:
[sheet showFromBarButtonItem:[self share] animated:YES];
但它不起作用.这是我的按钮代码:
UIBarButtonItem *share = [[UIBarButtonItem alloc] 
                                initWithTitle:@"Share"                                            
                                style:UIBarButtonItemStyleBordered …我现在将iPad应用程序移植到Android平板电脑,它使用了很多UIPopoverViewController.我尝试创建一个"布局",以全屏显示前面的小内容视图,它运行良好,但我想知道是否有这种功能的本机元素.谢谢你的时间.
android ipad uipopovercontroller uipopover android-4.0-ice-cream-sandwich
我有一个带有表格的popoverview,当我点击一个单元格时,我想传回一些数据,但我不知道该怎么做......
我有一个类ViewControllerA,我可以UIPopoverPresentationcontroller从中显示B类显示的数据,工作正常.当我在pop中选择一个值时,我想解雇它.我的代码如下
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *getLang=[self.myArr objectAtIndex:indexPath.row];
    if ([getLang isEqualToString:@"Ragul"]) {
        getLang=@"Received";
    }
    else if ([getLang isEqualToString:@"Gokul"])
    {
    getLang=@"Denied";
    }
    ViewControllerA *viewCont=[[ViewControllerA alloc]init];
    viewCont.delegate=self;
    [self  dismissViewControllerAnimated:YES completion:nil];
    [viewCont anOptionalMethod:getLang];
}
anOptionalMethod是一个自定义委托方法,我调用它来显示从PopOver中选择的值的数据.
-(void)anOptionalMethod:(NSString *)langLocal
 { 
    [self viewDidLoad]; 
    self.popController.delegate = self; 
    [self.ContPop dismissViewControllerAnimated:YES completion:nil];
    self.langShown=YES; 
    lblText.Text=MyValue; 
    [self.view addSubview:lblText]; // This calls viewDidLoad method 
} 
当我将结果添加到ViewControllerA与[Self.view addSubview:MyValue]该viewDidLoad方法被调用.所以这不应该发生.我知道这popOverPresentationController充当了父视图,因此我遇到了这个问题.所以请帮我解决这个问题.先感谢您..
ios ×7
objective-c ×5
ipad ×4
uitableview ×3
xcode ×3
iphone ×2
android ×1
android-4.0-ice-cream-sandwich ×1
autolayout ×1
ios7 ×1
uipopover ×1