首页 \ 问答 \ iOS 6 UINavigationController中的奇怪错误(Strange Bug in iOS 6 UINavigationController)

iOS 6 UINavigationController中的奇怪错误(Strange Bug in iOS 6 UINavigationController)

我在ios中发现了一个奇怪的错误。 当我使用UINavigationController并推送其他控制器时,titleView向右移动了很多,因为推送了多少个控制器

它看起来像这样:

在此处输入图像描述

我的代码很简单:

self.navigationItem.title = @"Test Title";

在第二种情况下,控制器在viewControllers堆栈中具有第5个。 所有情况下的控制器都是相同的。

我在AppDelegate中使用了UIBarButtonItemappearance

[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(-1000, 0) forBarMetrics:UIBarMetricsDefault];

I have found a strange bug in ios. When I use UINavigationController and push other controllers, the titleView shifted to the right so much as how many controllers was pushed

It's looks like this:

enter image description here

My code is simple:

self.navigationItem.title = @"Test Title";

In the second case, controller has 5th in viewControllers stack. The controller in the all cases is same.

I was using the appearance for UIBarButtonItem, in my AppDelegate.

[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(-1000, 0) forBarMetrics:UIBarMetricsDefault];

原文:https://stackoverflow.com/questions/16624327
更新时间:2023-10-08 16:10

最满意答案

它是预处理器的一部分,标记的串联,并且concatn(x,y)xy取代。


It's part of the preprocessor, concatenation of tokens, and concatn(x,y) is replaced by xy.

相关问答

更多
  • 它是一个托管指针 - 而*标记一个指向非托管对象的指针,^指向垃圾收集对象(由框架处理)。 阅读本文以获取有关在.NET中处理指针的方式的更多信息。 It's a managed pointer - while * marks a pointer to an object that is unmanaged, ^ points to a garbage collected object (handled by the framework). Read this for more information ab ...
  • @dynamic意味着“我的类将会在运行时找出如何回应这个问题。”使用运行时机制来拦截通常不会响应的消息。 在使用Core Data db存储持久性数据的情况下,NSManagedObject将其转换为-valueForKey:和-setValueForKey:调用。 看看斯坦福iPhone开发课程的第12讲 (2010年秋季)。 @dynamic means “my class will figure out how to respond to this at runtime.” Uses a runti ...
  • 作为算术运算+=/-=均值 在左侧添加/减去右侧,并将结果分配给左侧。 因此写a += 5与写a = a + 5 。 但是,此代码与事件和事件处理程序有关。 在事件处理程序的上下文中, +=/-= mean 在此事件的事件处理程序列表中添加/删除以下委托。 因此,您的示例代码会为按钮的Click事件添加一个新的事件处理程序。 它的编写方式称为内联实现。 请注意,在事件处理程序的上下文中,通常不能替换 Event += Handler; 通过 Event = Event + Handler; 因为没有办法 ...
  • ! 是否定的。 所以!! 否定否定。 重要的是结果将是一个int 。 !!x如果x == 0是!!0 ,那就是!1 ,也就是0 。 !!x如果x != 0是!!(!0) ,那就是!!1 ,那就是!0 ,也就是1 。 !! 如果要将任何非零值转换为1,同时确定0保持为0,则通常使用。 确实, !!NULL == NULL ,因为!!NULL == !!0和!!0 == !1 ,最后!1 == 0 。 因此,在你引用的短代码中,如果括号中的表达式的值为NULL ,则引用数组下标将为0 ,否则为1 。 ! is ...
  • 当您希望对象保留时,您应该使用new ,直到您delete它。 如果不使用new那么当对象超出范围时,对象将被销毁。 这方面的一些例子是: void foo() { Point p = Point(0,0); } // p is now destroyed. for (...) { Point p = Point(0,0); } // p is destroyed after each loop 有些人会说,使用new决定你的对象是在堆还是堆栈上,但这只是在函数中声明的变量才是真的。 在下面的示 ...
  • 你在看bitfields。 这些定义必须在一个结构中,它们意味着iph_ihl是一个5位字段而iph_ver是一个4位字段。 你的例子有点奇怪,因为在大多数机器上, unsigned char将是一个8位类型,但是那里声明了9位的字段。 一般来说,位域非常不便携,所以我建议不要使用它们,但你可以在这里阅读更多相关信息。 You're looking at bitfields. Those definitions have to be inside a structure, and they mean tha ...
  • 这在C#中称为终结器 。 它的作用是使用类似于析构函数的语法覆盖Finalize方法。 That is called a finalizer in C#. What it does is override the Finalize method using a syntax similar to a destructor.
  • 它是预处理器的一部分,标记的串联,并且concatn(x,y)被xy取代。 It's part of the preprocessor, concatenation of tokens, and concatn(x,y) is replaced by xy.
  • 在R中, c()函数返回一个向量(一维数组)。 在你的例子中: k <- c(0.5, 1) # k is a vector k[1] # is 0.5 (remember, R indices start on 1) k[2] # is 1 如果你想创建一个有1024个条目的矢量(假设为0.5个增量),你至少有两种方法来完成它: # One way k <- (1:1024) / 2 # this will be 0.5, 1, 1.5, 2, ... , 512 # Another way: k <- ...
  • 它被称为前向声明,使编译器能够识别该类,而无需实际知道其内部。 您只需通知编译器这样的类存在,并声明指向它的指针不会引发错误。 另一种方法是包含声明该类的相应头文件,但如果您只需要指向该类型的指针,则会过于沉重。 It's called a forward declaration and enables the compiler to recognise the class without actually knowing its internals. You just inform the compile ...

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)