different height of section header in grouped tableview - height

got a default grouped style table like left screenshot in below, but it looks having different height of section header, the top first is 69 px measured, while those rest are 40 px.
Why? Are they supposed to be same height, aren't they?
So I'd like to make them even by method of tableView:heightForHeaderInSection:, return 40
But.....it looks more worse! It amplifies heights like below middle one, even if putting section title on...like below right pic.
I just wanna have same height of section header. How to make it work?

Yea this is strange. I was able to make them even by adjusting the height of the section footers instead:
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
return 24;
}

Related

Having trouble understanding how HStack content works with fluid widths

I've been running into a pretty consistent problem with how views inside HStack work, with a simplified screenshot to exemplify the issue.
My expectation would be for the width of the green to basically be (expressed like an equation):
Section.width - Image.width
The section width is fluid, and the image width is explicit. Surely that means the green should be correctly calculated?
Any help with what seems to be a basic misunderstanding on my part would be hugely appreciated.
Actually you're right, but there are just default List/Form insets, which can be either changed or removed.
So all you need is
that gives on Xcode 13.4 / iOS 15.5
The height property in your frame for the image is messing with width dimensions. By setting the maxHeight to be infinity, the height property will expand the image to the max possible height, meaning the height of the section, even if it changes the width. You can think of it as, in a way, overriding the ability of the text to stretch its full width.
To fix this, consider changing the maxHeight property by adding a set height, or play around with different types of frames dimensions.
I know this doesn't talk about HStack's specifically, but feel free to check out this video to learn more about layout: https://www.youtube.com/watch?v=zczHBLtpRZo
If you want to launch an app on the app store, you may want to consider learning Geometry Reader to have dynamic dimensions across different screen sizes. This is a tutorial from a really good website, hacking with swift: https://www.youtube.com/watch?v=WNO1b58k7zg&t=505s

Text is stretching to a new page rather weirdly

Not sure if I am missing something but I am wrapping blocks of text around a bounding box. However, when it stretches to a new page, the text continues in the lower middle of the page instead of the top bit.
Not quite sure why and not sure if this is the default behavior of bouncing box since I am specifying x,y coordinates; although I couldn't find such thing in the docs
The code below reflects more or less what I have
pdf.bounding_box([absolute_bounds_left, pdf.cursor], width: absolute_bounds_right) do
pdf.text('Something')
pdf.text('Something else')
if something
pdf.text('Another thing')
...
end
...
end
I realised that if you specify a height option, the overflowing text will flow to the next page at [x,y]. So I realised that the if you do not supply a height, the only thing different is that it will stretch until the end of the page and then behave exactly the same, start at position [x, y].
I searched a bit more into the docs to validate this and indeed there is an example. Sorry no permalink so you have to search for it: http://prawnpdf.org/manual.pdf -> [text/free_flowing_text.rb]
If you notice there is another method, span which solved my free flowing text issue. It also comes with a position which amongst the standard :left, :right and :center it takes a numeric value as an offset on the y axis. See here

Opencart Colorbox AUTO height and width?

i tried everything, but i cant figure out how to do that, that when i press 'next' photo, and size of the hole popup changes with photo size. Like this : http://www.jacklmoore.com/colorbox/example1/ elastic transition example. I tried do maxWidth and maxHeight 100% and upload this new version of colorbox files to the server... style a little bit changes, but main thing, resposive auto width and height didnt. Maybe i did something wrong, but i almost finished my page and have one problem left.
I believe in Stackoverflow now :)
Firstly, make sure, that scalePhotos is not set to false. Secondly, maxWidth and maxHeight must be set with absolute values (pixels), not percentage. Percentage value is a way to get colorbox window with responsive dimensions. As I understand, you need "per contra" behavior, when colorbox's window does not change its size after new image is loaded from current set. So, you should use absolute values for maxWidth and maxHeight. For example:
$('.colorbox').colorbox({
scalePhotos: true, //'true' by default BTW
maxWidth: '600px',
maxHeight: '600px'
});

SKIA :: Get Text height of a text inside a canvas

I am using Skia for one of my sample program. I have a canvas and inside this I am writing text with font_size 30, this is the code snippet.
string = "Test String";
SkString text(string);
SkPaint paint;
SkScalar textWidth;
paint.setTextSize(SkIntToScalar(font_size));
paint.getFontMetrics(&metrics);
textWidth = paint.measureText(text.c_str(), text.size());
textWidth will give the exact width of the text inside the canvas. My question is how can I get the height of the text ? Please help.
I once had to look into this myself in the past, this link here should help you, even though it is java, fonts all work on the same idea as far as I know.
I assume you will want from the ascender to the baseline, Which is just the ascent. Or you may want the whole thing from top to bottom which is the ascent and descent combined,
If you were writing on lined paper, the baseline is the same as the line you write on, anything above that is the ascent, anything below is the descent.
I dont know anything about skia, But A quick look into skia, at this link here, that there is a public member called fAscent in FontMetrics, and fDescent, Maybe you can use those.
the font size your have specified as "font_size" is the height of single line text

Setting 100% height on an absolutely positioned element when the content expands past the window size

So after reading Stack Overflow and the web, I've gathered that there are two main tricks to achieving 100% height:
Set height:100% on both the HTML and BODY
Set your element to have either:
height:100%, or
top:0, bottom:0, position:absolute
However, even with those tricks I'm having difficulty setting the height of an absolutely positioned DIV to a true 100%. I can get 100% of the viewport size, but if the user scrolls down at all it becomes apparent that the div doesn't truly have 100% height.
I've made a simple JS Fiddle of the situation here:
http://jsfiddle.net/9FEne/
My question is: does anyone know any further tricks to get a true (ie. content-height, not viewport-height) 100% height absolutely positioned div?
Sorry, I missed the real question before and thought you wanted the window filled. If the issue is that the contents are longer than the window then what you need is to add position:relative to the body. http://jsfiddle.net/9FEne/7/
What is happening is that when you absolutely position something it positions (and sizes) relative to the nearest positioned element. If you don't tell it to position to the body then it will position to the window.
You can use jQuery to achieve this trick
var h = $(window).height();
$('#yourdiv').height(h);
I would use javascript to assign the height and width equal to document's height and window's width respectively; I've modified your jsfiddle to demonstrate it here:
http://jsfiddle.net/9FEne/1/