I am trying raise the height of the ranked successive views. There is a certain distance between each of these views.(Vertical spaces)When I increase the height of one of them, distorted distance between the bottom. I can not align all elements under one single at a time. This event is automatically done on Android. How do I make this operation on iOS.
That is the problem
Related
The image shows a 3x3 grid which is a vertical stackview, which contains 3 horizontal stackviews, which contain 3 buttons each. The top horizontal stackview has a correctly sized set of numbers within it(just by setting the font size to 80). The other two do not.
I want the numbers to take up the same amount of space on all devices so every number on each button is the same relative size on every device. This must be done programmatically! Not in IB... I cant find much info on this topic so even a link would be helpful please.
I'm having trouble setting up constraints.
This is the thing I am trying to achieve:
I have 2 objects A and B. I want there there to be a maximum of 100 points between A and B if its a larger screen, or less if its a smaller screen.
Also, I want there to be a minimum of a 20 point margin from the main view controller. So on a smaller screen the minimum spacing will be 20 points, and on a larger screen the margin can be as wide as needs in order to satisfy the space between A and B at 100 points.
To illustrate how I want it to look on various screens:
4 inch screen
I want there to be a 20 point margin on either side and the middle (space between A and B) can be variable, i.e. 100 or less.
5.5 inch screen
The margins can be variable and expand as large as they need to, but the middle section (space between A and B) can be a maximum of 100.
Any help how to achieve this would be greatly appreciated.
This can be achieved with help from three dummy views and two width constrains with different priorities. I set up a test project to test my thought. check it out to see whether it's what you needed
https://github.com/dopcn/testSeg
Check out the loading date label. It could be '2 May' or '24 December'.
I want to display the label 'days remaining' after it. Since the width of 'loading date' is dynamic, via auto layout I haven't been able to place 'days remaining' after it. It stays at a fixed distance.
How to adjust it in xcode, using autolayout?
I've been able to achieve it via code by disabling autolayout. However with iOS 7 coming up and autolayout would be essential to maintain iOS 6 and 7 at the same time, I thought it would be a good time to do it with autolayout.
Make sure that the spacing between your two labels is set to auto and that your days remaining label is left aligned. I suggest keeping a constraint between the trailing edge of your days remaining and the superview, but lowering the priority a bit. The goal there is to ignore it when the label should be far away from the superview, but not clip or go outside of the visible area when the date is very long.
You may also need to increase the content hugging priority of the date label and/or decrease the compression resistance of your days remaining label.
You may get better insight into what your labels are doing by setting the background color on them temporarily. The goal is to see how large your labels are, where the text is in the label, and where the spaces are. If there are large gaps between the labels that will help you figure out where to add constraints or adjust the priorities. If the labels are taking up the full width then it will help you get the alignment set correct.
I'm setting up a collection view and customizing its cell's width, inset, and inter-item spacing. With the current size that means there would be two columns in portrait and three in landscape. I let flow layout do the rotation adjustments & calculations, but the result is a stretched middle column. I think what is happening is flow layout is doing the math for the cell padding/spacing and not getting clean whole numbers. Then it adjusts the size of the actual cell by half a point. The result is an aliased & blurry looking cell.
I'm had this issue multiple times and each time - I manually calculate the values for each orientation to come out as a clean whole number. While this works, it doesn't seem very efficient. I'm wondering if there is a better way to do this, and if FlowLayout has the ability to say, give that half point to a margin or the empty space between the cells?
How can I get the max scroll for the X and Y in virtualstringtree during onchange event?
The GetTreeRect method gives the dimensions in pixels of the entire tree, or the dimensions of the client area, whichever is larger. Note that if there are no columns configured, then the size of the tree can vary based on which nodes are displayed on the screen at the time — the scrolling width changes according to the widest nodes visible.
The Bottom and Right fields of that rectangle determine the scroll-bar range.