I do not understand how to change the zPosition of the view, I am trying to do this, but nothing happens:
- (void)viewDidLoad { [super viewDidLoad]; UIView *view = [[[UIView alloc] initWithFrame:CGRectMake(100, 100, 100, 100)] autorelease]; view.backgroundColor = [UIColor blackColor]; view.layer.zPosition = -400; [self.view addSubview:view]; }
The CALayer document does not say anything before using this property. Does anyone know what I am missing?
Thanks, Vincent.
zPosition , , . , , , . , , .
zPosition
, , , zPosition. , Z, , . Z, , . , , .
- , . .
zPosition CALayer UIView.transitionWithView().
CALayer
UIView.transitionWithView()
var isFirstViewOnTop = true func switchCards() { self.isFirstViewOnTop = !self.isFirstViewOnTop UIView.transitionWithView( self, duration: 0.25, options: .TransitionCrossDissolve, animations: { () -> Void in self.firstView.layer.zPosition = self.isFirstViewOnTop ? 1 : 0 self.secondView.layer.zPosition = !self.isFirstViewOnTop ? 1 : 0 }, completion: nil ) }
Source: https://habr.com/ru/post/1760878/More articles:OData Proxy Generation Programming - odataAre two packages in one APK possible? - androidstrstr () is equivalent in C # - arraysThe list of functions provided by the Drupal service should have - drupalUsing RestSharp on Windows Phone 7 - windows-phone-7Convert timezone to xslt - xmlHow to prevent javascript and css messing up? - javascriptSync Framework 2.0 Error: The specified change tracking operation is not supported - .netHow to get all the minimal elements according to their first element in the internal list in a nested list? - pythonmatlab to C ++: Unable to open include file: 'mclmcrrt.h': no ββsuch file or directory - matlab-deploymentAll Articles