height

scrolling in listview with different cell height

落爺英雄遲暮 提交于 2019-12-04 18:14:48
问题 I have a listview and its rows have different heights. When I scroll up, rows appear to move up or down erratically. (I don't find the behavior when I scroll down) I suspect its due to the fact listView picks one of used rows the row is placed on top of visible rows. listView changes the row's height(here erratic movement) but it's a guess. I tried googling since this should be a common problem but couldn't find any. 回答1: In this case, setting the right item height did the trick : How to set

How to size a UIStackView depending on its content?

半腔热情 提交于 2019-12-04 17:52:04
问题 I would like to have a similar behavior than the <Table> HTML tag, in the sense where the frame is sized according to its content. In my very context, I use an UIStackView as the content view of a UITableViewCell. As items in the cell are various information, the resulting height of the cell should be variable. My strategy is to programmatically build a cell as a UIStackView with a .Vertical axis, as in the code snippet as follows: override func tableView(tableView: UITableView,

get height for a div with overflow:auto;

别等时光非礼了梦想. 提交于 2019-12-04 16:27:51
问题 i have a div with height:100px and overflow:auto the content is dynamic. i want scroll the div in the bottom i tried with $("#chat_content").scrollTop($("#chat_content").height()); but if the content is bigger than 100px $("#chat_content").height() returns 100 and the div isn't scrolled on the bottom how can i do? thanks 回答1: Get the scrollHeight property from the underlying DOM element: $("#chat_content").scrollTop($("#chat_content").get(0).scrollHeight); 回答2: try $("#chat_content")

Set html element to have 100% height on page with header

只愿长相守 提交于 2019-12-04 16:14:20
How can I set an html element to have a 100% height on a page that has a fixed height header? The layout is, of course, not fixed height. I already have the html and body set to simulate min-height: 100% correctly. I have tried the following ideas, but to no avail: 1. I have used the following CSS, but it uses a percentage-based height, which doesn't work well because my layout's header is a fixed 81px in height. #divContent { height: 82%; margin: 0; padding: 0; position: absolute; top: 82px; width: 950px; } 2. I have used the following in various combinations of the padding and margin, but

UITableView section header height for non-grouped table

て烟熏妆下的殇ゞ 提交于 2019-12-04 15:39:07
问题 Greetings! I know that UITableView sectionHeaderHeight is only used for grouped tables, but I'll ask anyway (in case there's some way to do this that isn't obvious) ... Is there a way to change the section header height (and with it, the font/size) for a NON -grouped table? Hoping "yes" or at least a "maybe" ... but fearing it might be a "no". Have at it, folks. 回答1: Yes. Use this delegate method: - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {

Getting SVG container size in snapSVG?

为君一笑 提交于 2019-12-04 14:42:26
What is the correct way to get the size of the 'paper' object with SnapSVG, as soon as it has been created? My HTML looks something as follows: <div id="myContainer" style="width: 900px; height: 100px" /> And then the Javascript code: function initViewer(elementId) { var element, elementRef, snap; elementRef = '#' + elementId; element = $(elementRef); element.append('<svg style="width: ' + element.width() + 'px; height: ' + element.height() + 'px; border: solid 1px black;"/>'); snap = Snap(elementRef + ' svg'); console.log(snap.getBBox()); } What I observe here is the bounding box has '0' for

Change height of textarea based on number of lines of text in javascript [duplicate]

天大地大妈咪最大 提交于 2019-12-04 14:18:29
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Autosizing textarea using prototype How do I change the height of a text area based on the number of lines of text that the user puts into it? For the example below if the user changed the text in the textarea to more than one line of text then the textarea would put a scroll bar on itself rather than changing its height to fit the number of lines. <textarea> This is the default text that will be displayed in

jQuery $(window).resize() not working when decreasing window's height

两盒软妹~` 提交于 2019-12-04 13:55:35
I have a div with an id "main", I want to set its height using jQuery and making so that on window.resize its height is modified using a function but for some reason it works well only when increasing window's height, when decreasing it it doesn't work. This is the JS: function setMainH() { var docH = $(document).height(); $("#main").height(docH - 40); } $(function() { setMainH(); }); $(window).resize(function() { setMainH(); }); EDIT: the problem appears either increasing or decreasing EDIT 2: the resize() event seem to be called correctly, I've tried with console.log("resizing"); on resizing

EditText Height Issue

◇◆丶佛笑我妖孽 提交于 2019-12-04 12:52:26
I am trying to set smaller height of EditText but still have not managed it. Here is my source: <EditText android:layout_width="150dp" android:layout_height="20dp" android:singleLine="true" android:textSize="10dp" /> This code cuts out text and a white rectangular shape appears around EditText control. I have also tried maxHeight/minHeight properties, but did not worked either. If anybody have solved this issue, please help. Or is this is the bug in the android? I can not even resize Spinner, same happens as with EditText. Thanks Irfan You are probably seeing bizarre orange rectangular shapes

Xamarin.Forms ListView size to content?

怎甘沉沦 提交于 2019-12-04 11:23:27
问题 I have a pretty large form (adapted mainly for tablets), that has a TabbedPage nesting a ScrollView and a vertical StackPanel containing many controls. I have few occurrences where I have a ListView that contains a few single-line items, and I need it to size to content. I'd like to get rid of its scroll-bars, but anyway I don't want it to take up more space than what's required for its items. Is there a way (even an ugly one) to achieve that without have to write a renderer x3 platforms?