![]() ![]() This time, instead of setting the height of the bar, we're gonna let its contents determine its height. Actually right now it is not exactly ambiguous because we'll assume that you want this top view to be the size of the image that currently has it. So now again our layout is a little bit ambiguous because we haven't specified how big we want any of these two views to be. And then basically be touching the image here on the top. It's gonna start to take up as much space as it needs on the bottom. And so this bottom view is gonna have the same constraints as our bar head earlier. And it's going inside when it's highlighted. So we're gonna drag this guy and put it inside this view. And we're gonna make it the bottom bar, so we're gonna resize it like this, into the sides. And we're gonna just drop it right there. Here is a view, again we simply drag it into our view here key. Easiest is to find a view here, you type in uiview in this object menu. And how you can do that is actually, there's a few ways. So we're gonna put them at the bar for maximum convenience. And to the top now, if you had five buttons down here you would have to move them individually. Although you could instead of laying them out down here, I would allow you to move it around you. Just a view that contains all five of them. If you have five buttons on the bottom, it's a lot more convenient if you put them all into a container view. And so when building interfaces you can nest views within each other, and that's what we're gonna do here. And while we deleted those constraints as we do this knowing one of the menus, one of the buttons, not the whole bar. We're gonna just move this one away give us some space down here. It will disappear and now we have errors because we have missing constraints because Xcode now doesn't know what we want anymore. You double click on it or even just single click on it and hit the Delete button. And we're actually gonna delete every single one of these. And when you take the comment and go to the site inspector, down here you'll see all the constraints. We're gonna delete constraints off this guy. Okay, so we're gonna delete some constraints first. So that it doesn't look, on all devices all the buttons are spread out at the bottom and not bunched up in any weird ways. First of all, there's a bit more buttons, and we're gonna use the other layout to make sure that they're sort of spaced out at the bottom properly. And that's actually more interesting for formatting reasons. So what we're gonna do in this lecture is make this bottom bar, instead of have one button, make it maybe have four or five. All right, so we still have our Flickr app here and it still looks like this. I'm not so sure we're gonna stay in the storyboard, and do a slightly more complex layout, and show some more ways you can set your auto layout constraints as well as some different kinds of constraints they can set. ![]() So now that you have a basic understanding of the layout. ![]()
0 Comments
Leave a Reply. |