height

Calculate exact character\string height in javascript

梦想的初衷 提交于 2020-01-10 06:11:26
问题 I'm working with canvases and i can't think of any solution, or find answer on line to my problem. I have a font that contains symbols\characters from varies sizes - heights and width. I want to draw some characters (Symbols) from the font and some on top\down of the symbol. The problem is that I can't figure out a way to have the exact height in pixels of the character that i'm drawing, and it's causes unwanted spaces between the center symbol to the one on top\down (for getting the width of

Java Swing: JList with ListCellRenderer selected item different height

房东的猫 提交于 2020-01-10 00:00:31
问题 I'm making a custom ListCellRenderer. I know that you can have different dimensions for each individual cell. But now I want to have a different dimension for the selected cell. Somehow, the JList is caching the dimension for each individual cell the first time it has to calculate bounds for each cell. This is my code: public class Test { static class Oh extends JPanel { public Oh() { setPreferredSize(new Dimension(100, 20)); } protected void paintComponent(Graphics g) { super.paintComponent

Make Div Height 100% of Screen

China☆狼群 提交于 2020-01-09 11:54:46
问题 I have been reading all the 100% div height discussions and I can't find a simple solution. How can I make my div take up all of the vertical height of the screen? Here is my code: css #mother { width: 100%; margin: 0 auto; z-index: 1; } #stripe_wrap { width: 1053px; min-height: 500px; margin: 0 auto; background: lime; } #stripe1 { width: 39px; min-height: 500px; margin: 0px 0px 0px 0px; background: #000; float: left; } #stripe2 { width: 39px; min-height: 500px; margin: 0px 0px 0px 0px;

Mobile Safari $(window).height() URL bar discrepancy

女生的网名这么多〃 提交于 2020-01-09 07:08:29
问题 I'm trying to set a fixed div that's 100% the window height. But mobile safari doesn't detect the correct window height. It always thinks that the URL bar is part of the equation. This is what I'm using currently but it doesn't account for the URL bar. $(function(){ $(document).ready(function(){ // On load alert($.browser); $('#right-sidebar').css({'height':(($(window).height()))+'px'}); }); $(window).resize(function(){ // On resize $('#right-sidebar').css({'height':(($(window).height()))+'px

Set div height equal to screen size

拥有回忆 提交于 2020-01-09 06:16:05
问题 I have a div element in twitter-bootstrap which will have content that will overflow vertically outside the screen. I would like the div to take the height of the size of the browser window and let the rest of the content scroll vertically within the window. I have a sample that is not working @jsFiddle #content { border: 1px solid #000; overflow-y:auto; height:100%; } <div class="container-fluid"> <div class="row-fluid"> <div class="span3">Side Bar</div> <div class="span9" id="content">

Set div height equal to screen size

巧了我就是萌 提交于 2020-01-09 06:15:05
问题 I have a div element in twitter-bootstrap which will have content that will overflow vertically outside the screen. I would like the div to take the height of the size of the browser window and let the rest of the content scroll vertically within the window. I have a sample that is not working @jsFiddle #content { border: 1px solid #000; overflow-y:auto; height:100%; } <div class="container-fluid"> <div class="row-fluid"> <div class="span3">Side Bar</div> <div class="span9" id="content">

Android: get height of a view before it´s drawn

让人想犯罪 __ 提交于 2020-01-08 15:48:08
问题 For an animation I need to know the height from a View. The Problem is, that the getHeight() method allways return 0 unless the View is drawn. So is there any way to get height without drawing it? In this case the View is a LinearLayout. EDIT: I try to adapt the expand Animation from https://github.com/Udinic/SmallExamples/blob/master/ExpandAnimationExample/src/com/udinic/expand_animation_example/ExpandAnimation.java With it I want to expand some more informations for a list item. I wasn´t

What is the height of iPhone's onscreen keyboard?

試著忘記壹切 提交于 2020-01-08 15:40:14
问题 The height in portrait and the height in landscape measured in points. 回答1: I used the following approach for determining the frame of the keyboard in iOS 7.1. In the init method of my view controller, I registered for the UIKeyboardDidShowNotification : NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; [center addObserver:self selector:@selector(keyboardOnScreen:) name:UIKeyboardDidShowNotification object:nil]; Then, I used the following code in keyboardOnScreen: to gain

HTML5 canvas style height vs attribute height

喜夏-厌秋 提交于 2020-01-07 04:35:10
问题 I am currently learning how to use HTML5 new elements and I stumbled upon a frustrating issue with all graphic functions such as fillRect() and drawImage(). I was setting the widgth and height with style="width: 75px;height: 10px;" instead of width="200" height="100" The result being that the graphics would not be the proper scale ever. My question is, why does it make a difference? There is something I obviously do not understand about it all. Thank you 回答1: I know that at least in JSF

custom height and width in custom inflate alertdialog layout android

两盒软妹~` 提交于 2020-01-07 02:17:06
问题 i'm trying to inflate a custom layout in an alertdialog. I get it, but width is expanded to fill_parent. I have tried in xml file to put wrap_content or custom size (example 200dp) and it's ever fill_parent. I want to put my own height and width, like (200dp, 150dp), how can i put this? I have read and tried some solutions in this web, but i can't solve my problem, can anyone help me? thanks in advance for it. I give my java code here `>View ff = getLayoutInflater().inflate(R.layout