iOS 6 UINavigationController中的奇怪错误(Strange Bug in iOS 6 UINavigationController)
我在ios中发现了一个奇怪的错误。 当我使用UINavigationController并推送其他控制器时,titleView向右移动了很多,因为推送了多少个控制器
它看起来像这样:
我的代码很简单:
self.navigationItem.title = @"Test Title";
在第二种情况下,控制器在
viewControllers
堆栈中具有第5个。 所有情况下的控制器都是相同的。我在AppDelegate中使用了
UIBarButtonItem
的appearance
。[[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:
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
forUIBarButtonItem
, in my AppDelegate.[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(-1000, 0) forBarMetrics:UIBarMetricsDefault];
原文:https://stackoverflow.com/questions/16624327
最满意答案
它是预处理器的一部分,标记的串联,并且
concatn(x,y)
被xy
取代。It's part of the preprocessor, concatenation of tokens, and
concatn(x,y)
is replaced byxy
.
相关问答
更多-
它是一个托管指针 - 而*标记一个指向非托管对象的指针,^指向垃圾收集对象(由框架处理)。 阅读本文以获取有关在.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; 因为没有办法 ...
-
C中的“!!”是什么?(What is “!!” in C? [duplicate])[2022-06-15]
! 是否定的。 所以!! 否定否定。 重要的是结果将是一个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决定你的对象是在堆还是堆栈上,但这只是在函数中声明的变量才是真的。 在下面的示 ...
-
在C中'''做什么?(In C what does ':' do? [duplicate])[2022-08-15]
你在看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.
-
“##”在C中做什么?(What does “##” do in C? [duplicate])[2022-09-25]
它是预处理器的一部分,标记的串联,并且concatn(x,y)被xy取代。 It's part of the preprocessor, concatenation of tokens, and concatn(x,y) is replaced by xy. -
R在c中做什么?(What does c do in R? [duplicate])[2022-01-31]
在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 <- ... -
“class className;”本身在C ++中做什么?(What does “class className;” by itself do in C++? [duplicate])[2022-05-10]
它被称为前向声明,使编译器能够识别该类,而无需实际知道其内部。 您只需通知编译器这样的类存在,并声明指向它的指针不会引发错误。 另一种方法是包含声明该类的相应头文件,但如果您只需要指向该类型的指针,则会过于沉重。 It's called a forward declaration and enables the compiler to recognise the class without actually knowing its internals. You just inform the compile ...