Tag: uiview

带有Autolay的UIScrollView内容大小

我正在使用UIScrollView自动布局更改内容enter code here ize值如下: UIView ScrollView UIView ( contentView ) 在运行时,我将UITextView & UIImageView添加到带有约束( conentView ,bottom, conentView ,right)的conentView , 但contentView大小并没有改变 , UIScrollView contentSize也是如此。 那么可能是什么问题呢?

为UIView设置Alpha是UIScrollVIew的子视图,速度非常慢

我有UIScrollView包含几个UIView当我尝试setAlpha:对于UIView ,我得到1.5秒的延迟,直到UIView阿尔法设置。 下面是setContentOffset在setAlpha:之前运行的代码setAlpha:尽pipesetAlpha:在代码中被写入 -(void)setAlphaForIndex:(int)Index{ for (UIView *v in imgScroll.subviews){ if (v.tag == Index) { [v setAlpha:0.6]; if (![self checkIfImageInScrollRange:Index]){ if (v.tag < 5) [imgScroll setContentOffset:CGPointMake(0, 0) animated:YES]; else [imgScroll setContentOffset:CGPointMake((Index – 5) * (CELLWIDTH) + (Index – 5 – 1) * 3, 0) animated:YES]; } } else { [v setAlpha:1.0]; } } }

在UIAlertView的自动dimissal之后,导航栏的色彩更改

我写了我的自定义UIAlertview允许在某些情况下自动解雇。 现在,在iOS 7的自动解雇发生我的导航栏的色彩变化。 根据iOS7转换指南: https://developer.apple.com/library/ios/documentation/userexperience/conceptual/transitionguide/TransitionGuide.pdf 当出现警告或操作表时,iOS 7会自动调暗其后的视图的色调。 为了响应这种颜色变化,在其渲染中使用tintColor的自定义视图子类应该覆盖tintColorDidChange以适当刷新渲染。 任何想法,如果这只能在自定义的UIAlertView中处理。 以下是我自定义UIAlertView的代码: #define kStartupFailAlert 203 #import "RunnerUIAlertView.h" @implementation RunnerUIAlertView – (id)init { self = [super init]; if (self) { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(removeAlert) name:kRemoveVisibleAlert object:nil]; } return self; } – (void)removeAlert { if (self.tag != kStartupFailAlert) { // If not kRunnerStartupFailAlert – as it will be auto […]

dynamic设置tableview的高度并将其限制在一定范围内swift 3?

我有一个表视图作为popUpTableView,因为我需要设置表视图高度为每行的dynamic。 我正在joincellForRowAtIndexpath popupTableView.height = popupTableView.contentSize.height 它工作正常,但问题是当没有单元格增加,然后桌面高度增加比它的原始高度 extension DiagnosisViewController :UITableViewDataSource { func numberOfSections(in tableView: UITableView) -> Int { return 1 } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { if tableView == diagnosisTableView { return self.diagnosisModel.count } else if tableView == popupTableView { return self.popupDiagnosisModel.count } return 0 } func tableView(_ tableView: UITableView, cellForRowAt […]

– :在ios 11中发送给实例的无法识别的select器

> Scrollview有内容视图来pipe理子视图, 错误进来ios 11在ios 10中正常工作 – [UIView adjustedContentInset]:无法识别的select器发送到实例0x10296d680 2017-10-02 12:34:11.931454 + 0530 MobifinX1_Subscriber [1235:135465] *终止应用程序由于未捕获的exception'NSInvalidArgumentException',原因:' – [UIView adjustedContentInset]:无法识别的select发送到实例0x10296d680' *第一掷调用堆栈:(0x186f53d38 0x186468528 0x186f611f8 0x19071bcc4 0x186f596e4 0x186e3f0dc 0x1906f2628 0x1906f23f0 0x1906f1bc0 0x1906f18f0 0x19040c964 0x1904e8e48 0x19040ae04 0x19040aa34 0x19040a95c 0x190361000 0x18af310b4 0x18af35194 0x18aea3f24 0x18aeca340 0x1905c7744 0x190ca6718 0x190c9f574 0x186efc358 0x186efc2d8 0x186efbb60 0x186ef9738 0x186e1a2d8 0x188cabf84 0x1903c7880 0x100abcb5c 0x18693e56c)的libc ++ abi.dylib:以NSExceptiontypes的未捕获exception终止

UIActivityIndi​​catorView不显示/开始animation

我有一个UIActivityIndi​​catorView的视图控制器和触发同步的button。 同步在一个单独的类中执行,通常在后台执行。 同步可以从我的应用程序的不同部分触发,我的视图控制器被通知同步事件。 现在,当我点击button时,UIActivityIndi​​catorView不会变得可见或不生动。 这是我在viewDiDLoad中的代码: self.syncNowActivityIndicatorView.hidesWhenStopped = YES; self.syncNowActivityIndicatorView.color = [MRStyleController getFirstLightColor]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(leechStarted) name:MRLeechStartedNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mergeStarted) name:MRMergeStartedNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fileSyncStarted) name:MRFileSyncStartedNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(leechFailed) name:MRLeechFailedNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mergeFailed) name:MRMergeFailedNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fileSyncFailed) name:MRFileSyncFailedNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(leechCompleted) name:MRLeechCompletedNotification object:nil]; [[NSNotificationCenter […]

添加子视图后,不能点击UIButton

我正在使用一种方法为我的button添加阴影。 问题是在那之后,我不能点击它们。 我将userinteractionenabled属性添加到YES,但仍然无法点击。 这是代码。 我该如何解决? 我错过了什么吗? – (UIView*)putView:(UIView*)view insideShadowWithColor:(UIColor*)color andRadius:(CGFloat)shadowRadius andOffset:(CGSize)shadowOffset andOpacity:(CGFloat)shadowOpacity { CGRect shadowFrame; // Modify this if needed shadowFrame.size.width = 0.f; shadowFrame.size.height = 0.f; shadowFrame.origin.x = 0.f; shadowFrame.origin.y = 0.f; UIView * shadow = [[UIView alloc] initWithFrame:shadowFrame]; shadow.userInteractionEnabled = YES; // Modify this if needed shadow.layer.shadowColor = color.CGColor; shadow.layer.shadowOffset = shadowOffset; shadow.layer.shadowRadius = […]

在Storyboard中使用viewController类的一个实例

所以我遇到了另一个小问题,花了早上试图弄清楚。 几乎没有成功。 我正在Xcode 5中编写一个iOS7应用程序,其中包含故事板。 在应用程序的一部分,我需要三个共享相同viewController类的屏幕。 这些屏幕是UIViewControllers 。 我使用UISegmentControl根据条件从屏幕切换到屏幕。 如果用户没有完成某些步骤,我禁用了该控件。 我使用BOOL值检查某些步骤是否已完成,并将其值设置为YES / NO. 问题是当我想回到最后一个屏幕 – 我正在得到我的viewController类的新实例。 这有两个问题: 每次用户在两个视图之间都会增加内存 当新实例加载时,BOOL值和所有其他属性均为零。 在我的细分控制中,我是这样看待观点的: -(void)segmentcontrol:(UISegmentedControl *)segment { if (segment.selectedSegmentIndex == 0) { self.viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"stepOne"]; [self presentViewController:self.viewController animated:NO completion:nil]; } else if (segment.selectedSegmentIndex == 1 ){ self.viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"stepTwo"]; [self presentViewController:self.viewController animated:NO completion:nil]; }else { } } 这个viewController是我的BaseViewController一个子类 […]

为什么顺序UIViewanimation同时显示?

我已经写了一些代码,依次在屏幕上移动一些对象。 当每个对象完成移动,下一个开始。 代码的结构与此类似: 模型: moveObject { // Code to move the object … [delegate moved:self]; } 代表: moved:(MyClass *)o { UIView* v = [self viewForObject:o]; [UIView animateWithDuration:1.0 animations:^{ [v setCenter: [model center]]; } completion:^(BOOL finished){ // Move object [model moveObject]; }]; } 虽然代码似乎运行良好,但屏幕上发生的事情是,animation被分组为批次:大量的一次都发生,然后另一个组都开始。 如果我在[model moveObject];行放置一个断点[model moveObject]; 然后在没有任何animation被显示在屏幕上的情况下被finished设置为true几次。 然后,偶尔, finished将被设置为false ,并且在我让debugging继续之后,所有的animation将在屏幕上执行。 编辑 : 但是,如果我更改代码,以便在moveObject被调用时偶尔不移动对象,而是返回没有动作的对象,并且等待用户移动对象(并且因此通过委托的moved:select器调用回代码),那么animation的短串顺序发生。 ie问题似乎只发生在代码处于无限循环时。 怎么了?

uiview上的圆angular半径不按预期工作

cornerRadius = (view.frame.size.height / 2.0) 似乎没有按预期工作。 如何解决这个问题? 可能是什么问题? 输出屏幕 –