objective c - how to adjust subviews height in iOS -


I have 2 subview A and B Place in Scrollview. The first placed in the scrollview and then in the Place BA Subview, Uiimageview B Subview contains only Uttextfield. In a subview, I can upload an image for the gallery. Before uploading the image to UIImagePickerController.I need "A" Subview before uploading the image to uiimageView. No need to show up. U is the first time on uuscrollview. Upload an image comes first on a subview uiimageView and then the B subview is placed.

  - (zero) viewDidoadload {[Super ViewDidoadload]; Score = [[UIScrollView alloc] init]; Scrol.frame = CGRectMake (0, 100, self.view.frame.size.width, 250); Scrol.delegate = self; Scrol.scrollEnabled = Yes; [Self.view addSubview: scrol]; Scrol.contentSize = CGSizeMake (221, 650); Scrol.backgroundColor = [UIColor blueColor]; A = [[UIView alloc] init]; Ephraff = CGRactam (10, 10, 221, 100); A.backgroundColor = [UIColor yellowColor]; [Scrollsviewview: A]; B = [[UIView alloc] init]; Beeframe = CGRactam (10, 120, 300, 100); B background color = [UIColor grayColor]; [Scrollsubject: b]; Firstimage1 = [[UIImageView alloc] init]; Firstimage1.frame = CGRectMake (5, 10, 180, 80); Firstimage1.backgroundColor = [UIColor redColor]; //firstimage1.image = [UIImage imageNamed: @ "Defult.png"]; [A aidview: firstmuse 1]; UITextField * Field 1 = [[UITextField alloc] init]; Field1.frame = CGRectMake (10, 10, 221, 30); Field1.backgroundColor = [UIColor whiteColor]; [B adsubview: field 1]; UITextField * field2 = [[UITextField alloc] init]; Field2.frame = CGRectMake (10, 50, 221, 30); Field2.backgroundColor = [UIColor whiteColor]; [B adsubview: field 2]; GetImages = [[UIButton alloc] init]; GetImages.frame = CGRectMake (0, 0, 28, 25); [Self.view addSubview: getImages]; [GetImages addTarget: Self-action: @Selector (AIMJS :) Control events: UIControlEventTouchDown]; [GetImages setbackground image: [UIImage imageNamed: @ "Defult.png"] forState: UIControlStateNormal]; Img1 = [[UIImagePickerController alloc] init]; Img1.delegate = self; Img1.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; Img1.delegate = self; If (firstimage1.image) {firstimage1.hidden = NO; A.hidden = No; // If there is an image then just set A_View according to your requirement [one set frame: CGRactam (10, 10, 221, 100)]; According to the B_View and the Y coordinate + A_View height [B setframe: CGRactMake (0, A. Frame.origin.a + efrem size hi + 10, 300, 100)]; } And {firstimage1.hidden = yes; // And if the image is not hidden, hide Aviv and give your interview in place of AView A.hidden = YES; [B setframe: CGRactam (10, 10, 300, 100)]; } "-" zero ", zero]; action sheet 11.actionSheetStyle = UIActionSheetStyleBlackTranslucent; [actionseat 11 show invoice: self .vv];} - (zero) action sheet: (UIActionSheet *) button clicked on action sheetAtindex: ( NSITer) Button Index {img1.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; Int i = Button Indices; Switch (i) {Case 0: img1.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; [Self-Current ViewController: Animated Animation: Yes Complete: ^ {}}; 1: img1.sourceType = UIImagePickerControllerSourceTypeCamera; [self present ViewController: animated img1: yes complete: ^ {}]; Breakdown; Default: actionSheet11.hidden = YES;}} - (Zero) Image Picture Controller: (UIImagePickerController *) Picker was FinishPickingMediaWithInfo: (NSDictionary *) information {[Picker Dismissed Model Vic Controller Amit: Yes]; firstimage1.image = [info ObjectForKey: @ "UIImagePickerControllerOriginalImage"];}   

No need of the image to load a subview to show and use B UIScrollView.after Loading comes first in ImageView Make a UIImagePickerController comes first and then place B.my code image before it's B But before when uploading the image, subview it now

please help me thanks

  - (zero) imagePickerController: (UIImagePickerController *) Picker didFinishPickingMediaWithInfo: (NSDictionary *) information {firstimage1.image = [informationForKey: @" UIImagePickerControllerOriginalImage "]; If (firstimage1.image) {firstimage1.hidden = NO; A.hidden = No; // If there is an image then just set A_View according to your requirement [one set frame: CGRactam (10, 10, 221, 100)]; // and B_View set according to Y coordinate + height A_View co [b setFrame: CGRectMake (0, A.frame.origin.y + A.frame.size.height + 10, 300, 100)]; [Picker Dismodal Moodle Controller Permission: Yes]; } And {firstimage1.hidden = yes; // And if the image does not hide there then hide it hidden Aview and put your Bview in place of AView A.hidden = yes; [B setframe: CGRactam (10, 10, 300, 100)]; }}    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -