I set up a group in my WatchApp Storyboard which has a width relative to container 1 and height relative to container 0.5.
Inside this group I have 20 horizontal aligned groups with a width relative to container 0,05. The spacing of the group is set to 0 but when i set a background color to all groups I end up like this.
As you can see, some spacings are really zero but sometimes there is a small gap of about 1 px. Is this some sort of bug? Is it possibile to perfectly align the groups so that it looks like it is one solid background?
Please don't tell me, that I can set the background color of the first group. Obviously I know that, i need it to work like this!
Thanks!
I believe the problem is that the width of the screen isn't evenly divisible by 20. The width of the 42mm screen is 312 pixels, which divided by 20 is 15.6 pixels. Apple is probably truncating this to an integer value for performance, which results in the gaps.
I reproduced your problem and then, to test my theory, I created 8 groups instead of 20 and set them to a width of 0.125. This resulted in no gaps, which makes sense since 312 is divisible by 8.
The 32mm watch has a width of 272 pixels and, doing factorization of the two I got:
272 = 2 * 2 * 2 * 2 * 17
312 = 2 * 2 * 2 * 3 * 13
Which shows that eight columns is the maximum by which you can evenly divide both sizes.
If you have to have 20 columns, then I would set each to a fixed width, some at 15 and some at 16 pixels for the 42 mm, and 13/14 pixels for the 32 mm to get the layout you want.
Related
I'm trying to create a Google Sheets template that is exactly A4. The reason for that is I need to insert a picture in there that is absolutely placed and sized.
So, I'm figuring that since A4 is 210x297mm and Google Sheets default resolution is 96dpi, I need 793.59x1122.363 pixels.
Since a cell is 100x21 pixels, I need 7 cells horizontally + an additional cell that is 93 pixels large and 53 cells vertically + a cell that is 9 pixels high.
Which prints too big (A4, portrait, Scale Normal 100%, Margins 0,0,0,0):
too big
If I manually adjust the size of the cells to get a complete grey area without white lines on a single page, like this:
perfect size
I need 7 cells + one cell that is 85 px large x 53 cells + one cell that is 8 px high.
Note that (53*21+8)/785 = 1.428, which is not sqrt(2), the standard A4 ratio.
Why ? Thanks!
Say I need to have a view which has leading and trailing spacings, on iPhone SE the spacings should be 16, on larger phones I can have 32 as spacing, however in portrait mode the horizontal size class is always Compact, which means I can't apply different spacings for different size classes.
Then I thought about having High priority constraints instead of Required, and make the intrinsic content size of the view to be, say, 288, so on iPhone SE, the spacings have to be 16 and 16 (ie. 16 + 288 + 16 = 32), but on larger phones it can be 32. Haven't tried this but can someone point me the correct direction of solving this problem?
Thanks!
Edit:
The view is actually a UILabel, and I don't want to give it a hardcoded width constraint.
I solve these issues more generally by using a constraint multiplier. It may not be exactly 16/32 but you can get a similar effect.
You can set hard limits like required min 16, required max 32 and then set another a lower priority constraint of parent width * someMultiplier
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
In JIRA 5
Administration -> System -> User Interface -> Look And Feel
when I changing logo with image size 57x30px (width/height)
Text from page: "The height of the logo image will be constrained to a maximum of 30 px.
Also, it is recommended to use an image with a 57 px width."
its displayed on jira page with size 187x40px (width/height) and looks very blurry.
How can I fix this? (disable logo stretches)
For those interested in Jira 6.4 and confluence 5.8...
In JIRA, the image size you want (without scaling) will be 30px tall. Any image height taller than 30 will be scaled to 30. JIRA automatically puts padding on your image 5 top 5 bottom...for total of 40 pixels high. JIRA will allow you to do an image wider than 57...it pushes the menu over..at least in the default theme.
In Confluence, for some reason the authors decided 5 pixels was not enough padding. So, they added 3 more. Top and bottom. For a total of 16 pixels of padding.
Yes, the confluence tag line below the image upload says, "limit to 48 pixels tall", but this is a lie. if you make it 48px tall, it will be scaled to 24 px tall. Then the 16 pixels of padding is added for a total hight of 40px.
I will be checking on Stash/Bamboo in the future.
I have a view sized 320 x 376
On top of this view, i'd like to place a UIImageView leaving 4 (not sure what is the unit of measurements here) points to each size. This (i hope) will create a frame around the image.
So, from the stand point of the view,
Starting x,y coordinates will be 4 x 4.
Calculating the width of the top view, i 320 - 4 - 4 = 312
Calculating the height of the top view, i 376 - 4 - 4 = 368
When said measurements are in place, however i get
Why am i not seeing a 4 points buffer towards the bottom?
Tested with your params, it's ok for me :
The only reason that I found to explain why this happens is because the view that is behind the 2 others (border view + image view) is shorter than 376, so it hides the bottom of your views :
(here, it's the green one)
OK
Too short