android NDK抱怨std :: nearbyint不是std的成员(android NDK complains std::nearbyint is not a member of std)
我想在android gcc中使用std :: nearbyint但是然后ndk抱怨
std::nearbyint
不是std的成员。 我的代码中包含了cmath
标头,并且OSX的构建相同。这有解决方法吗? 可以写我自己的
std::nearbyint
版本吗? 我在android上使用NDK14b
I want use std::nearbyint in android gcc but then ndk complains that
std::nearbyint
is not a member of std. I have thecmath
header included in my code & the same builds well for OSX.Is there a workaround for this ? Is possible to write my own version of
std::nearbyint
? I am usingNDK14b
on android
原文:https://stackoverflow.com/questions/43739081
最满意答案
设置和获取视图坐标不匹配。 你正在设置框架
- (void)updateLayoutForNewOrientation:(UIInterfaceOrientation)orientation
,在NSLog中你使用bound打印。获得宽度的正确方法如下
NSLog(@"x= %f y= %f w= %f h=%f",self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, self.view.frame.size.height);
你的代码
NSLog(@"%f %f %f %f",self.view.bounds.origin.x, self.view.bounds.origin.y, self.view.bounds.size.width, self.view.bounds.size.height);
改变与框架相反或反之亦然。
There is mismatch in setting and getting view coordinate. you are setting frame in
- (void)updateLayoutForNewOrientation:(UIInterfaceOrientation)orientation
and in NSLog you are printing using bound.Correct way to get width is following
NSLog(@"x= %f y= %f w= %f h=%f",self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, self.view.frame.size.height);
your code
NSLog(@"%f %f %f %f",self.view.bounds.origin.x, self.view.bounds.origin.y, self.view.bounds.size.width, self.view.bounds.size.height);
Change bound with frame or viceversa.
相关问答
更多-
是的,它的方向依赖于iOS8,而不是错误。 您可以从WWDC 2014中查看更多信息: “View Controller Advancements in iOS 8” 引用报价: UIScreen现在面向界面: [UIScreen界限]现在面向界面 [UIScreen applicationFrame]现在面向界面 状态栏框通知是面向对象的 键盘框架通知是面向界面的 Yes, it's orientation-dependent in iOS8, not a bug. You could review se ...
-
使用willAnimateRotationToInterfaceOrientation:duration:代替。 此方法在旋转动画块内被调用,并且此时所有边界都已正确设置。 文档。 Use willAnimateRotationToInterfaceOrientation:duration: instead. This method gets called from within the rotation animation block, and all the bounds have been set c ...
-
在更新功能中,您将视图居中。 func update(bounds: CGRect) { **let position = CGPoint(x: bounds.width / 2.0, y: bounds.height / 2.0)** trackLayer.bounds = bounds trackLayer.position = position pointerLayer.bounds = bounds pointerL ...
-
iOS 7中的方向(Orientation in iOS 7)[2022-02-12]
- (void)viewWillLayoutSubviews { UIInterfaceOrientation toStatusBarInterfaceOrientation = [UIApplication sharedApplication].statusBarOrientation; if (toStatusBarInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toStatusBarInterfaceO ... -
我设法实际使用autolayout来解决这个问题,我设置了宽度和高度约束以及垂直和水平中心约束 然后在我的viewDidLoad我去 previewImageHeightConstraint.constant = previewCardContainer.frame.size.height - 20 previewImageWidthConstraint.constant = previewCardContainer.frame.size.width - 20 在我的orientation ...
-
let portrait = UIScreen.mainScreen().bounds let landscape = CGRectMake(0, 0, portrait.size.height, portrait.size.width) let portrait = UIScreen.mainScreen().bounds let landscape = CGRectMake(0, 0, portrait.size.height, portrait.size.width)
-
我发现它发生的原因,我会保留这个问题,每个人都可能遇到同样的问题。 我正在使用自定义转换来解除UIViewController,UIViewControllerAnimatedTransitioning,并且我不检查自定义转换中是处于横向模式还是纵向模式。 如果您遇到同样的问题,请确保您恢复到屏幕边界。 I found it why it's happening, I'll keep the question for everyone might hit the same issue. I'm using ...
-
设置和获取视图坐标不匹配。 你正在设置框架- (void)updateLayoutForNewOrientation:(UIInterfaceOrientation)orientation ,在NSLog中你使用bound打印。 获得宽度的正确方法如下 NSLog(@"x= %f y= %f w= %f h=%f",self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, self.view.frame.s ...
-
我已经解决了在视图之间设置模态segue然后使用以下代码进入实现文件: - (void)willAnimateRotationToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration { if(self.interfaceOrientation == UIDeviceOrientationPortrait || self.interfaceOrientat ...
-
如何在方向更改后获得正确的视图边界?(How do I get the correct bounds of a view after an orientation change?)[2024-02-29]
如果我理解你的问题,你应该尝试设置: self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 在您的视图上,以便在方向更改时“更新”它们的边界。 I ended up adding the pickerview to an action sheet like so: UIActionSheet *aac = [[UIActionSheet alloc] initWith ...