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 |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
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
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,372145198
8,372145198
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 |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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