【问题标题】:UIView/UIButton coordinates flippedUIView/UIButton 坐标翻转
【发布时间】:2013-01-04 05:42:54
【问题描述】:

我有一个 coreplot 项目。 viewcontroller 中视图的类已更改为 CPTGraphHostingView。

创建图表后(这工作正常), 我正在添加一个按钮作为子视图,这会启动一个弹出窗口 显示的按钮是倒置的。我在不同的视图控制器中具有相同的控件,并且工作正常。 Popover 看起来也不错。

这是创建和添加 UIButton 的代码

 UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button addTarget:self
           action:@selector(monthSelection)
 forControlEvents:UIControlEventTouchDown];
[button setTitle:@"Change Month" forState:UIControlStateNormal];
button.frame = CGRectMake(330, 650, 111, 40);
[self.view addSubview:button];

[这里是正在发生的事情的屏幕截图。 UIButton 应该显示在弹出框下方的某个位置。我错过了什么。

【问题讨论】:

    标签: ipad uiview ios6 core-plot


    【解决方案1】:

    不要将子视图添加到图形托管视图。相反,让其他视图成为宿主视图的兄弟,即将它们添加为同一个父视图的子视图。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多