How to set constraints when all buttons are of different size - ios

I have one view on view controller on that view I have six buttons I want to set constraints to these buttons but I am not able to do that. When I set constraints two of them get compressed don't know why.
I am sharing screen Shot,Please help me Thank you

You don't need six buttons for designing above screen. You can do this by using UITableView and custom UITableViewCell.
For more : Customize tableview cell
Or by using three UIViews by sub viewing UIImage and UILable and then add UITapGestureRecogniser to that UIView.
For more : Tap gesture

Related

Issue with Autolayout and StackView while using ScrollView

I a trying to create a UIScrollView that fits exactly the contents of its subviews. I do this with a StackView and the scroll view's height is determined by how much content there is in the stack view. Within the stack views, there are views that contain an UIImageView and a UITextView
The UIScrollView starts below the title view, however every time I want to add another view (which it should scroll when the content is bigger than the actual frame) there is an issue with the scroll view's Y position. This works perfectly if I only add UILabels and UITextFields, using the same procedure
How can I do it so I can programmatically add views on the stack view that includes an UIImageView and a UITextView, just as the View Controller with labels and textfields does.
You can download my app project at the following url
https://github.com/francisc112/DescriptionWithImageApp.git
Instead of a scroll view why don't you use a table view and create a custom cell with the stackview and its contents inside the cell and you can dequeue the same cell for adding multiple information.
I was not able to open your project
So I Tried opening your StoryBoard and Re-Viewing your constraints Applied , here is what I have Done Please check in following Link
Link - https://drive.google.com/file/d/1D-dzKsSqpx7dWsI5fYRdAfCMY_vENoIR/view?usp=sharing
View Hierarchy
Note - For such output I will prefer using a TableView instead of StackView as Same output can easily be achieved using TableView

How do I make my UIView scrollable horizontally programmatically using Objective-C?

I have created nine table view controllers using page view controller and UIView. Inside UIView, there are nine buttons to points the table view controller.
My problem is, I want to make my UIView scrollable programmatically. In my project, all the buttons are in the same controller and no space to move.
Can anyone help?
My project image:
use UICollectionView and set UICollectionView.pagingEnabled = YES.
UIScrollView is the same but you need to do something for sub views and scrollView contentSize.
use HMSegmentedControl third party for same

How can i set an imageview over 2 table view cells

I'm trying to construct a register page similar to the one used by instagram or foursquare , the problem is they have a special mechanism in a table view where you can set your avatar , like so :
It seems like an imageview was added above 2 tableview cells , obviously the insets are modified so the line doesn't touch it , but i can't seem to place the image or modifiy the tableview cell width .
How can i achieve this ?
This is probably a single cell with 3 UIImageViews, 2 UITextFields, UIButton and a dividing line being another subview (perhaps thin UIView). You can easily achieve this with a subclass of UITableViewCell.
Update: review this question for steps how to achieve it in storyboard: How do you load a prototype cell from a storyboard? You would need IBOutlets for UITextFields and IBAction for UIButton.

Can I put 2 UITextFields in the same tableViewCell?

Check out this image below, this is what I'm trying to accomplish, but I ran into some problems. The first approach I made was to have an imageView (blue square) and 2 separate tableViews within a scrollView. Each tableViewCell would have textFields inside them. The first issue was when the keyboard came into the view, I would move the view up to make sure the bottom textFields were not covered up. I then wanted to be able to scroll up and down so I could still see the top textFields as well. This didn't work because when I nested the tableView inside the scrollView, The scrollView wouldn't scroll. I was also having a problem with setting the firstResponder to pass from textField to textField on the second table only.
I then decided it would be better to create 1 tableView, and add a custom cell to hold my imageView and two textFields. My question is, is it possible to create that custom cell that will hold my imageView and two textFields? would this be a better approach?
Thanks
Wow, I think your can do it easily by UITableView. All you need to do is customising UITableViewCell.
This is possible using subviews. However, why you aren't considering UIViewController or UIScrollViewController for this design?

Adding subviews on a UITableView

I'm working on a project were I use mostly UITableViews. The user enters data and the App gives the result of a calculation. I have two buttons: "Calculate" and "Reset". I want to add a subview containing these two buttons and have them displayed at the bottom of the screen. By Storyboards, I can add the subview, but it sticks to the button of the UITableView, not the screen.
Any idea on how to accomplish that? Should I mess with the constrains between the subview with the buttons and self.tableview.superview ?
Any help is appreciated!
You can use a standard UIViewController instead of a UITableViewController, and add a UITableView to your view controller. You can then place subviews at will.
Do not forget to connect datasource and delegate of your tableview.

Resources