height

CSS: DIV containing no height on float set

≯℡__Kan透↙ 提交于 2019-12-17 10:40:48
问题 assume we have this code: <div id='upperDiv' style='min-height:200px;border: 1px solid #000000;'> <div id='rightDiv' style='float:right;width:75%;'> content1 </div> <div id='leftDiv' style='float:left;width:25%;'> content2 </div> </div> <div id='lowerDiv' style='height:50px;border: 1px solid #000000;margin-top:5px;'> content3 </div> When content of rightDiv and leftDiv passes the 200px height (the min height) upperDiv doesn't grow, so its content overlaps the lower div. If I remove the float

Finding number of lines in an html textarea

流过昼夜 提交于 2019-12-17 09:34:27
问题 I'm writing a mobile web application where scrollbars are not displayed on the device's browser. Due to this, I'm trying to dynamically modify the height of the textarea to make it bigger, however I don't know of any way to actually get the line count on an html textarea. Any help would be greatly appreciated! EDIT So I realize now that it's not newlines per se, but actual line wrapping. So when one line finishes it wraps the text to the next line. It appears as if it is a new line. Any way

Android set height and width of Custom view programmatically

人盡茶涼 提交于 2019-12-17 08:13:01
问题 I have created a custom view named Graphview . Here is the structure for the GraphView class. public class GraphView extends View { public GraphView(Context context, float[] values, String title, String[] horlabels, String[] verlabels, boolean type) { super(context); ........ } .................. ................. } I have added the view in a tablerow using addview() . It is working fine. Now I want to set height and width for the GraphView . How to do that? 回答1: The easy way is to set the

Android set height and width of Custom view programmatically

ぃ、小莉子 提交于 2019-12-17 08:11:28
问题 I have created a custom view named Graphview . Here is the structure for the GraphView class. public class GraphView extends View { public GraphView(Context context, float[] values, String title, String[] horlabels, String[] verlabels, boolean type) { super(context); ........ } .................. ................. } I have added the view in a tablerow using addview() . It is working fine. Now I want to set height and width for the GraphView . How to do that? 回答1: The easy way is to set the

Height percentage not working in CSS

大兔子大兔子 提交于 2019-12-17 06:55:25
问题 I am trying to use height property using percentages, but it doesn't work. I want to use percentage so it looks fine in any resolution. <div id="bloque_1" style="height: 80%;background: red"> </div> How can I make it work? 回答1: When you are using % for width, or height, the 1st question you should ask is that 80% of what? So you also need to apply height to the parent element, so assuming that this element of yours is inside the body tag, you need to use this in your CSS html, body { height:

Div width 100% minus fixed amount of pixels

拈花ヽ惹草 提交于 2019-12-17 06:20:26
问题 How can I achieve the following structure without using tables or JavaScript? The white borders represent edges of divs and aren't relevant to the question. The size of the area in the middle is going to vary, but it will have exact pixel values and the whole structure should scale according to those values. To simplify it, I'd need a way to set "100% - n px" width to the top-middle and bottom-middle divs. I'd appreciate a clean cross-browser solution, but in case it's not possible, CSS hacks

Adjust UILabel height to text

核能气质少年 提交于 2019-12-17 02:33:43
问题 I have some labels which I want to adjust their height to the text, this is the code I wrote for this now func heightForView(text:String, font:UIFont, width:CGFloat) -> CGFloat{ let label:UILabel = UILabel(frame: CGRectMake(0, 0, width, CGFloat.max)) label.numberOfLines = 0 label.lineBreakMode = NSLineBreakMode.ByWordWrapping label.font = font label.text = text label.sizeToFit() return label.frame.height } EDIT: The issue was not in this piece of code, so my fix is in the question itself. It

Change UITableView height dynamically

家住魔仙堡 提交于 2019-12-17 00:29:42
问题 I want to change the height of my tableview from another viewcontroller based on the sum of its cells' heights, as they are dynamic. Is it at all possible? Thanks Add-on: What I basically have is a UserProfileViewController that has a containerview on half of the screen. There I add different other viewcontrollers: In the case of the wall button this is how I add the viewcontroller and it's subsequent tableview: - (IBAction)wallButtonPressed:(id)sender { //Check if there is an instance of the

Increasing height of a div while dynamically loading content (it's height is 100%)

扶醉桌前 提交于 2019-12-14 03:59:59
问题 I have a div(InnerDiv) which contains a grid with paging enabled... After some user actions , data inside that grid will load and we will have a big grid! The problem is when grid's data loads , overflow the div's bottom portion(InnerDiv) and some of those data get's displayed out of the div. my css of body and html like below : html, body { margin: 0; /* get rid of default spacing on the edges */ padding: 0; /* get rid of default spacing on the edges */ border: 0; /* get rid of that 2px

Set UITableViewCell's height depending on the height of a UILabel

蹲街弑〆低调 提交于 2019-12-14 03:42:51
问题 I would really appreciate it if you could tell me how I could set the height of a UITableViewCell depending on the height of a UILabel. My current code to set the UILabel's height is: cell.textLabel.lineBreakMode = UILineBreakModeWordWrap; cell.textLabel.numberOfLines = 0; cell.textLabel.text = [self getItemForKey:kSummary]; cell.textLabel.font = [UIFont systemFontOfSize:15]; cell.textLabel.textColor = [UIColor colorWithRed:54.0f/255.0f green:54.0f/255.0f blue:54.0f/255.0f alpha:1.0f]; CGSize