If i change the Spinner width like below only the up/down arrow place is changed-the text area remains as default, how do i change the size of the spinner -including the text area.
<p:spinner id="spinnerBasic" style="width:50px;"/>
The Primefaces spinner is a compound component consisting of a text field and the control elements. All this will be rendered inside a <span>.
If you only want to change the size of the text input, the p:spinner has a size attribute:
<p:spinner id="spinnerBasic" size="20"..../>
From the primefaces documentation:
size: Number of characters used to determine the width of the
input element.
The corresponding css class is ui-spinner-input. Changing the width attribute of this class to get the desired changes.
Related
I was wondering how I would be able to obtain the actual button label's font size that the text gets rendered with... not the one obtained through label.font. The reason I need this is because since I'm allowing for the button label's text to get resized based on the width of the button, the size therefore also changes. However this change isn't reflected upon in the label.font property. This value is needed because I basically draw the text myself (and set the default text to transparent), so I'd need to be able to get the actual font size so that the text I render fits the button's bounds. Thanks, and I hope you understood my question.
I wonder what ui element I should use for large sets of text. Eg anything between 200 - 1000 characters.
I already place the text inside a scrollview so it doesn't have to ve scrollable or editable etc, I just want to display text.
So what should I use between label / text view / text field?
Thanks in advance.
Text views are good for texts with varying lengths, but they have a scroll view of their own. You may consider using a normal UILabel and setting the "Lines" property to 0. I know that sounds strange, but setting it to 0 tells the label that it is a multi-line label. Then you can use auto layout to establish the width of the UILabel. It will grow down based on the amount of text in it. Text fields would be inappropriate for displaying texts in most cases; they are better for user input.
I have created a text field using the story board in Xcode 5 - I have applied a background and applied text to the field - but the brief requires the background to expand according to the length of the containing text (the text is a persons name - as shown below )
Is it possible to auto expand the width based on the content size?
try to use -sizeToFit method .
By default form elements (input) in jQuery Mobile span over the full width of the screen.
How can I make them fit to the size of their content ?
You can use data-inline="true" on buttons and selects to make them span to the width of their content.
I have been recently getting into iOS development, and I'm trying to build something that looks (very roughly) like this: http://falkendev.com/downloads/ios-sample.png
Basically, it's a page that shows simple text -- large header text that may span multiple lines, a separator line, and then smaller descriptive text that may be a variable length. This text does not need to be editable. I'm working using interface builder, but I imagine that what I want done may need to be done programmatically?
Two questions:
-- How do I go about creating these text fields so that they adjust their height based on the content? I'm assuming I would be using a standard "text" field for each, make them not editable, and then programmatically change their height? And then based on the height of the various text fields, I would need to adjust the positioning of the text fields and the divider line between them?
-- How do I go about making the page scrollable? It's possible that the descriptive text will be long and would extend off the edge of the screen. I would want the whole page to be scrollable, not just the descriptive text section. I'm assuming I would place all my elements within a scroll view... but currently when I do that and view it, the view just gets centered (cutting off both the top and the bottom) and I can't scroll it at all.
Thanks for any help!
set the scrollview content size to greater than its actual size to
make it scrollable like this :
scrollView.contentSize = CGSizeMake(YourWidth ,YourHEight ); // Here you can change either of height and width to make it more scrollable in that direction.
You can use UITextView object to have a scrollable text field...
which can scroll to show additional text..just set its editing
property to NO.
Otherwise to dynamically update label height yourself...use
NSString sizeWithFont method