w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Setting UITableViewCell height and the cell's text label based on the text height
I think that the problem might be of adjusting the vertical alignment of the text in the UILabel instance. I think you should do the following inside cellForRowAtIndexPath: cell.infoLabel.text = _content[[indexPath row] * 2]; cell.infoLabel.numberOfLines = 0; [cell.infoLabel sizeToFit]; More details about it can be found in the following link: Vertical Alignment of UILabel Text Hope this helps! :)

Categories : IOS

Is there a way to set a minimum height on an ASP.NET Panel control?
You can use min-height in CSS. div#UpcomingAudits {min-height:300px;} The downside to this is it's not supported IE6. Known issues: IE7 does not support "inherit" as a value. IE8 has some bugs with max-width/height combined with overflow: auto/scroll.

Categories : C#

Setting SSRS Tablix Minimum Height
There isn't an easy way of doing that but you can create empty rows outside the groups of the tablix and then hide them (using the Row Visibility property) if the data in your dataset contains a certain number of rows.

Categories : Reporting Services

How to get table cell to use minimum height when using rowspan?
Will this help? table.spanned tr:first-child {height:100%} Result: http://jsfiddle.net/MrLister/zqDDu/4/

Categories : HTML

Changing minimum height of a content div to match 2 others dynamically
There is probably a CSS way to sort this out but that would require you to alter your HTML. I would go with a simple jQuery solution such as the below: <title></title> </head> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> <body> <div id="wrapper" style="width:608px;"> <div id="leftcolumn" style="float: left; border:2px solid #000000; width: 300px;"> <p>1</p> <p>2</p> <p>3</p> <p>4</p> </div> <div id="rightcolumn" style="float: right; border:2px solid #000000; width: 300px;"> <p>1</p> <p>2</p> <p>3</p> </div> <div id="lefboottomtcolumn" style="clear: left; float: left;

Categories : Javascript

How to change layout to use minimum height in android programming?
Use a linearlayout and remove the margins, like this: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" > <TextView android:id="@+id/textview_username" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@+string/email" /> <EditText android:id="@+id/textinput_username" android:layout_width="match_parent" android:layout_height="wrap_content" android:ems="10" android:inputType="textEmailAddress" /> <TextView android:id="@+id/textview_password" android:layout_width="wrap_content" a

Categories : Android

Android - Bitmap Height = Textview Text Height?
Try using ImageSpan(resizedbitmap, ImageSpan.ALIGN_BASELINE) instead of ImageSpan(resizedbitmap) The default alignment of an ImageSpan is ALIGN_BOTTOM.

Categories : Android

GetContent() empty string and empty inputstream for "text/html"
Use the JavaMail demo program msgshow.java (download here) to read your test message file to make sure the file format is correct. (Copy/paste isn't the most reliable way to create a properly formatted file.) "java msgshow -m The JavaMail FAQ has additional debugging tips.

Categories : Java

jQuery: Style all empty child TDs only if the first (:first) TD contains no text (:empty)
Select rows, check if first child not is empty, get its matching siblings: $('tr td:first-child:empty').siblings("td[class*='_crew']:empty").css("background", "#DDCEC0"); $('tr td:first-child:not(:empty)').siblings("td[class*='_crew']:empty").css("background", "#DDCEC0"); Apparently I had it backwards!

Categories : Javascript

How to prevent text from going below an image when the height of text exceed the height of the image?
Try float:left on the image and float:right on the text like: .eventphoto { padding:1px; width:200px; float:left; margin-right:15px; border-radius:2px; } .desc { font-size:0.8em; line-height:13pt; float:right; }

Categories : HTML

R - How to draw an empty plot with no height?
Well... I don't know why you would want to do this, but here goes: # Make a png file png('x.png', height=1) # Change the margins of the plot to 0 on each side par(mar=rep(0,4)) # Make an empty plot plot.new() # Close the connection to the png file dev.off()

Categories : R

IOS heightForRowAtIndexPath, setting height for empty cells
I am assuming that the cell displays allStrings as its content. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { /* Contains the string */ NSString *allStrings = [self convertMainData:indexPath]; if(allStrings.length == 0) return 20.0f; // return default height. Adjust accordingly UIFont *cellFont = [UIFont fontWithName:@"Helvetica" size:17.0]; CGSize constraintSize = CGSizeMake(280.0f, MAXFLOAT); CGSize labelSize = [allStrings sizeWithFont:cellFont constrainedToSize:constraintSize lineBreakMode:NSLineBreakByWordWrapping]; return labelSize.height + 20; }

Categories : IOS

Flowing text with minimum column width around floated image
The simplest method I found is to set the minimum width of the column by preventing the first few words from wrapping: <style> .chunk { white-space: nowrap; } </style> <p><span class="chunk">If one examines</span> Derridaist reading... This works well, but: I have to manually edit the text each time I do this I can't precisely control the column width (in ems or pixels)

Categories : HTML

Placeholder text in html form becomes oddly positioned upon increasing height of text box
If you're using a text input (<input type="text">), it is a single-line input. Changing its height will not allow for more lines. Consider using a <textarea> instead, as they are multi-line inputs. http://jsfiddle.net/mkHvK/

Categories : Jquery

How to make a scale with height as it receives more text
input type text is always single line. you can use for multi-line and you can specify rows and columns. Look at this: http://css-tricks.com/textarea-tricks/ for auto resizing textareas and other tricks.

Categories : PHP

How to get the max text length for a fixed width/height EditText and text size
Okay so, i have gleaned some ideas about it and i am presenting it to you. I have not yet tested it. So first what we need to do here is get edit text max-length. But, only limited parameters have their getters, so I don't think you can read it . So write length (Say 12) in values folder and use it in xml layout and your java class. Now its not hard-coded . 1)Create integer.xml in values <?xml version="1.0" encoding="utf-8"?> <resources> <item type="integer" name="max_length">12</item> </resources> 2)In layout <TextView android:id="@+id/tv" android:layout_width="fill_parent" android:layout_height="wrap_content" android:maxLength="@integer/max_length" /> 3) in Java : int maxLength = getResources().getInteger(R.integer.max_l

Categories : Android

zedgraph custom auto scale - but with minimum (of Min), and minimum of Max)
You can manually set 'Y' axis as follows, myPane.YAxis.Scale.Min = 0; myPane.YAxis.Scale.Max = 10; myPane.AxisChange(); zedGraphControl1.Invalidate(); and if you want to reverse the scale set the 'IsReverse' property to 'True' myPane.YAxis.Scale.IsReverse = true;

Categories : C#

SKIA :: Get Text height of a text inside a canvas
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.

Categories : C++

Android layout I want to see a text and under this text image which fill all empty space
you should DEFINITLY not use nested linear/relative la yout like that. anyway, try to put on the relativelayout around the image somthing like above or toleftof ect EDIT : i didn't see your major layout was linear, then you'll have to use weight=1 on every inside layout,so that they don't priorityse on each other. but using relative layouts for one elements are just making your app slow

Categories : Android

SQL: How to find minimum in minimum set with joins efficiently
You can use a ranking function: WITH CTE AS( SELECT School, Class, DOB, Stu_ID, RN = ROW_NUMBER() OVER (PARTITION BY School ORDER BY Class ASC) FROM dbo.Schools ) SELECT School, Class, DOB, Stu_ID FROM CTE WHERE RN = 1 Demo Ranking Functions (Transact-SQL) OVER Clause (Transact-SQL) WITH common_table_expression (CTE)

Categories : Sql Server

Check All input text fields in form empty or not on Submission, Ignore if at least one text field is filled
You are not calling preventDefault on event object, you need to call preventDefault on event object. The way you are trying to check that all fields are empty wont give you correct result as it will checks children not value. :empty Select all elements that have no children (including text nodes), reference $('#dataFieldMapping').submit(function(event) { lst = $('input:text').filter(function(){ this.value != ""; }); if(lst.length) { alert("Empty!"); preventDefault(); } });

Categories : Javascript

Use ifstream to read a text file with random generated numbers in columns and find the minimum and maximum from the list?
Here is an improved version of your code which works perfectly for me: #include <string> #include <iostream> #include <fstream> using namespace std; int main() { const int userInput = 2; float SalePrice[userInput]; //Make an array float RegularPrice[userInput]; //Make an array string readFile; ifstream inputFile; inputFile.open("yourFile.txt"); if(!inputFile){ //Check wether the file is open cout<<"Couldn't open file!" << endl; return -1; } // To get you all the lines and place the line from myfile into the line variable for(int count = 0; !inputFile.eof() && (count < userInput) ; ++count) //Why are you using a while-loop if you need to count the iterations {

Categories : C++

calculate and set the height for some div (initial settings). When the height of the browser window is changed --> change the height for div
is that what you are looking for? api.jquery.com jQuery(document).ready(function () { $(window).resize(function() { var height = document.documentElement.clientHeight - 500; if (height < 135) { height = 135; } document.getElementById('left_space').style.height = height + 'px'; jQuery(window).resize(function () { var height = document.documentElement.clientHeight - 500; if (height < 135) { height = 135; } document.getElementById('left_space').style.height = height + 'px'; }); }); });

Categories : Javascript

Why height of paragraph and text box is not same in a Div?
That is because you have not made a reset of their custom attributes. Like <p> and <input> by default have some padding and margin and when you add a height, it populates accordingly.

Categories : HTML

Text line height
Java 8+ implementation RT-21683 Allow to change line-to-line spacing was implemented to add a line spacing feature to JavaFX Java 8. The line spacibg API is defined on Text, TextFlow and Labeled nodes via a lineSpacing property and associated getters and setters. Spacing is defined in pixels, like the rest of JavaFX layout. Java 2.2- implementation If you cannot use Java 8+, you will need to implement line spacing yourself, e.g. By setting spacing on a VBox with separate Text nodes for each line. Discussion of unit measurements in JavaFX It seems that there is a corresponding (stylable) css property? If it's defined in pixels, how do I make it dpi aware css properties work can work with em units if you use them. See for example the default modena.css stylesheet which measures

Categories : Java

Finding the actual text height AS3
Your question highlights a legacy of weak semantics in the Flash typographic APIs. The textHeight property represents the relative size of the typeface in pixels, it doesn't account for the pixel representation of the particular glyphs (the individual letter shapes) in the TextField. As far as I know there is no direct programatic way to measure a glyph with Flash. However, you could bitmap the textfield and use getPixel to guess: var tf:TextField = …your textfield… var wide:int = tf.width; var tall:int = tf.height; var bmpd:BitmapData = new BitmapData(wide, tall, true,0xFFFFFFFF); bmpd.draw( tf ); var totalPixels:int = wide * tall; var index:int = totalPixels + 1; var useIndex:int; var xPixel:int; var yPixel:int; while (--index > 0) { useIndex = index - 1; xPixel = useIn

Categories : Actionscript

How to make the height of a div box depend on how much text is in it
You would do this by not setting a height at all which is equivalent to height: auto;. By default the div will wrap the content. If it's not doing that then post a jsfiddle.

Categories : CSS

Html text box height in percentage
make this http://jsfiddle.net/Fytmf/1/ CSS html, body { margin: 0; padding: 0; } html, body, #mything, #mything textarea { height: 100%; } HTML <div id="mything"> <textarea rows="10" cols="40">x</textarea> </div>

Categories : CSS

jcanvas resize text by width and height
The only way to resize text in jCanvas is with the scaleX, scaleY, or scale property. The width and height properties (for text drawings) are read-only, so you can't change them yourself. $("canvas").drawText({ fillStyle: "#000", x: 100, y: 100, fontFamily: "sans-serif", fontSize: 36, text: "This text is squished", scaleX: 0.5 });

Categories : Javascript

How to define the uitableviewcell height dynamically according by the text
in the UItableViewDelegate method - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath you can return height for specific row. For that you must know the length of the string you want to display in that row. see this link Get tableView:heightForRowAtIndexPath: to happen after tableView:cellForRowAtIndexPath:?

Categories : Iphone

how to increase uibutton height according to its title text?
Use this code for help UIFont font = myButton.titleLabel.font; CGSize textsize = [myButton.titleLabel.text sizeWithFont:font constrainedToSize:CGSizeMake(myButton.frame.size.width,999) lineBreakMode:UILineBreakModeTailTruncation]; [myButton setFrame:CGRectMake(myButton.frame.origin.x,myButton.frame.origin.y,myButton.frame.size.width, textsize.height)];

Categories : Iphone

How to prevent from text to extend the
  • container height?
  • You could use position: relative on the li and position: absolute on the a. Using absolute will cause the a element to not affect the li's dimensions. In this way you can also position it in the corner. http://plnkr.co/edit/kcjCl1?p=preview .sidebar li{ padding: 50%; position: relative; } .sidebar a{ display: block; position: absolute; bottom: 0; left: 0; }

    Categories : CSS

    Jquery Expand Height with text overflow
    Remove your heightfix jQuery and css code (it isn't really necessary in this situation) and change height:30px; to min-height:30px;. Working fiddle - http://jsfiddle.net/sqGkg/

    Categories : Jquery

    ios: Change height of cell to size of text
    You want to use [str sizeWithFont:]. There are some other variations on this method that take into account a constrained width and line break mode. Look here to find something that will work: http://developer.apple.com/library/ios/#documentation/uikit/reference/NSString_UIKit_Additions/Reference/Reference.html

    Categories : IOS

    Is there a way to increase the height of the strip.text bar in a facet?
    First, modify the levels so that they include a linebreak: levels(diamonds$color) <- paste0(" ", levels(diamonds$color) , " ") Then adjust as necessary. eg: P <- ggplot(diamonds, aes(carat, price, fill = ..density..)) + xlim(0, 2) + stat_binhex(na.rm = TRUE)+ facet_wrap(~ color) P + theme(strip.text = element_text(size=9, lineheight=0.5)) P + theme(strip.text = element_text(size=9, lineheight=3.0))

    Categories : R

    text field value not becoming empty
    You have multiple, nested "onready" calls ($(function(){ ... });) The .focus(function(){ .. }); code is wrapped in $(function(){ ... }); which is also wrapped in an $(function(){ ... });. Make sure you have only one $(function(){ ... });! $(function() { // EVERY jQuery code goes here });

    Categories : Javascript

    Software Testing: Difference in text box height in different browsers
    All browsers show slightly different behavior when it comes to displaying content. A web-developer should always try to make the website look the same in all supported browsers. So if an element on the site appears different in two browsers, I would consider that a bug in the website.

    Categories : Testing

    100% height input-field and align text vertically
    Try this, should align vertically: input { //// vertical align position: relative; top: 50%; -webkit-transform: translateY(-50%); -ms-transform: translateY(-50%); transform: translateY(-50%); //// margin: 0; padding: 0; width: 100%; height: 100%; text-align: center; border: 0; outline: 0 } Not sure if the height: 100% will avoid the job, try it without height: 100% if it doesn't work. If that's the case, maybe the solution is to calculate the height everytime with javascript/jquery.

    Categories : Javascript

    Text length + table-cell + percentage height - what is going on here?
    I tried wrapping the growing element in a div that is using absolute positioning, it seemed to have the effect you're asking for: http://jsfiddle.net/fschwiet/2RgPV/. See the "fixme" div that was added. The idea is that the fixme div kind of seals whatever is happening within it from whatever table logic lives outside. .fixme { position:absolute; top:0px; bottom:0px; right:0px; left:0px; overflow:hidden; }

    Categories : HTML

    Android - Button height not decreasing to wrap text
    Font size does not depend on button height. If you set it too small to fit the text, you will get the result you observe EDIT wrap_content would usually do the trick, however Button class sets some layout parameters like margin, background so it takes more space. You may get rid of Button and use i.e. TextView class, styled by hand to match your design. onClickListener will work perfectly fine with it and you will get result you want and full control over your button EDIT 2 As this is bit related - there's AutoFitTextView widget on Github that deals with automatic text size scalling: https://github.com/grantland/android-autofittextview

    Categories : Android



    © Copyright 2017 w3hello.com Publishing Limited. All rights reserved.