ios having alignment issues of an image in an content view inside a tableview
up vote
0
down vote
favorite
I have a custom cell inside an UITableView
. Within that custom cell I am trying to put an image and to vertically align it horizontally. As soon as I do that I get that red line.
I have clicked the update frames button, there were no pop up of a menu to select any options.
Heres an image to get a better understanding.
What do I need to do to fix it?
ios uitableview
add a comment |
up vote
0
down vote
favorite
I have a custom cell inside an UITableView
. Within that custom cell I am trying to put an image and to vertically align it horizontally. As soon as I do that I get that red line.
I have clicked the update frames button, there were no pop up of a menu to select any options.
Heres an image to get a better understanding.
What do I need to do to fix it?
ios uitableview
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a custom cell inside an UITableView
. Within that custom cell I am trying to put an image and to vertically align it horizontally. As soon as I do that I get that red line.
I have clicked the update frames button, there were no pop up of a menu to select any options.
Heres an image to get a better understanding.
What do I need to do to fix it?
ios uitableview
I have a custom cell inside an UITableView
. Within that custom cell I am trying to put an image and to vertically align it horizontally. As soon as I do that I get that red line.
I have clicked the update frames button, there were no pop up of a menu to select any options.
Heres an image to get a better understanding.
What do I need to do to fix it?
ios uitableview
ios uitableview
edited Nov 11 at 0:09
asked Nov 11 at 0:03
tensteps
33
33
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
The constraints for your image view are not sufficient for Auto Layout to know where & how big the image view should be:
Constraints for views need to specify the position (x, y) plus the size of the view (width, height).
To fix your issue, add constraints for:
- leading
- trailing, or width
- top
- bottom, or height
You could also press Add missing constraints in the menu that pops up when you press that |△|
button, but I discourage you from doing so, because then it might add constraints you were not actually looking for.
Yes the add missing constraints fixes the problem and gives me what I was looking for. I would like to know how to do this manually. Is there a way to see the exact constraint that it placed? I see that it put in a leading constraint and an equal relation. Dunno what that is.
– tensteps
Nov 11 at 0:17
From the image it seems you have only added a center y constraint. You can see all constraints added to a view on the right side where it says Constraints in bold (and the graphic).
– LinusGeffarth
Nov 11 at 0:19
To manually add constraints, press on the little square button right next to the triangle one. Then select whichever constraints you want to add.
– LinusGeffarth
Nov 11 at 0:21
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
The constraints for your image view are not sufficient for Auto Layout to know where & how big the image view should be:
Constraints for views need to specify the position (x, y) plus the size of the view (width, height).
To fix your issue, add constraints for:
- leading
- trailing, or width
- top
- bottom, or height
You could also press Add missing constraints in the menu that pops up when you press that |△|
button, but I discourage you from doing so, because then it might add constraints you were not actually looking for.
Yes the add missing constraints fixes the problem and gives me what I was looking for. I would like to know how to do this manually. Is there a way to see the exact constraint that it placed? I see that it put in a leading constraint and an equal relation. Dunno what that is.
– tensteps
Nov 11 at 0:17
From the image it seems you have only added a center y constraint. You can see all constraints added to a view on the right side where it says Constraints in bold (and the graphic).
– LinusGeffarth
Nov 11 at 0:19
To manually add constraints, press on the little square button right next to the triangle one. Then select whichever constraints you want to add.
– LinusGeffarth
Nov 11 at 0:21
add a comment |
up vote
0
down vote
accepted
The constraints for your image view are not sufficient for Auto Layout to know where & how big the image view should be:
Constraints for views need to specify the position (x, y) plus the size of the view (width, height).
To fix your issue, add constraints for:
- leading
- trailing, or width
- top
- bottom, or height
You could also press Add missing constraints in the menu that pops up when you press that |△|
button, but I discourage you from doing so, because then it might add constraints you were not actually looking for.
Yes the add missing constraints fixes the problem and gives me what I was looking for. I would like to know how to do this manually. Is there a way to see the exact constraint that it placed? I see that it put in a leading constraint and an equal relation. Dunno what that is.
– tensteps
Nov 11 at 0:17
From the image it seems you have only added a center y constraint. You can see all constraints added to a view on the right side where it says Constraints in bold (and the graphic).
– LinusGeffarth
Nov 11 at 0:19
To manually add constraints, press on the little square button right next to the triangle one. Then select whichever constraints you want to add.
– LinusGeffarth
Nov 11 at 0:21
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
The constraints for your image view are not sufficient for Auto Layout to know where & how big the image view should be:
Constraints for views need to specify the position (x, y) plus the size of the view (width, height).
To fix your issue, add constraints for:
- leading
- trailing, or width
- top
- bottom, or height
You could also press Add missing constraints in the menu that pops up when you press that |△|
button, but I discourage you from doing so, because then it might add constraints you were not actually looking for.
The constraints for your image view are not sufficient for Auto Layout to know where & how big the image view should be:
Constraints for views need to specify the position (x, y) plus the size of the view (width, height).
To fix your issue, add constraints for:
- leading
- trailing, or width
- top
- bottom, or height
You could also press Add missing constraints in the menu that pops up when you press that |△|
button, but I discourage you from doing so, because then it might add constraints you were not actually looking for.
answered Nov 11 at 0:09
LinusGeffarth
8,254135098
8,254135098
Yes the add missing constraints fixes the problem and gives me what I was looking for. I would like to know how to do this manually. Is there a way to see the exact constraint that it placed? I see that it put in a leading constraint and an equal relation. Dunno what that is.
– tensteps
Nov 11 at 0:17
From the image it seems you have only added a center y constraint. You can see all constraints added to a view on the right side where it says Constraints in bold (and the graphic).
– LinusGeffarth
Nov 11 at 0:19
To manually add constraints, press on the little square button right next to the triangle one. Then select whichever constraints you want to add.
– LinusGeffarth
Nov 11 at 0:21
add a comment |
Yes the add missing constraints fixes the problem and gives me what I was looking for. I would like to know how to do this manually. Is there a way to see the exact constraint that it placed? I see that it put in a leading constraint and an equal relation. Dunno what that is.
– tensteps
Nov 11 at 0:17
From the image it seems you have only added a center y constraint. You can see all constraints added to a view on the right side where it says Constraints in bold (and the graphic).
– LinusGeffarth
Nov 11 at 0:19
To manually add constraints, press on the little square button right next to the triangle one. Then select whichever constraints you want to add.
– LinusGeffarth
Nov 11 at 0:21
Yes the add missing constraints fixes the problem and gives me what I was looking for. I would like to know how to do this manually. Is there a way to see the exact constraint that it placed? I see that it put in a leading constraint and an equal relation. Dunno what that is.
– tensteps
Nov 11 at 0:17
Yes the add missing constraints fixes the problem and gives me what I was looking for. I would like to know how to do this manually. Is there a way to see the exact constraint that it placed? I see that it put in a leading constraint and an equal relation. Dunno what that is.
– tensteps
Nov 11 at 0:17
From the image it seems you have only added a center y constraint. You can see all constraints added to a view on the right side where it says Constraints in bold (and the graphic).
– LinusGeffarth
Nov 11 at 0:19
From the image it seems you have only added a center y constraint. You can see all constraints added to a view on the right side where it says Constraints in bold (and the graphic).
– LinusGeffarth
Nov 11 at 0:19
To manually add constraints, press on the little square button right next to the triangle one. Then select whichever constraints you want to add.
– LinusGeffarth
Nov 11 at 0:21
To manually add constraints, press on the little square button right next to the triangle one. Then select whichever constraints you want to add.
– LinusGeffarth
Nov 11 at 0:21
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53244633%2fios-having-alignment-issues-of-an-image-in-an-content-view-inside-a-tableview%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown