increasing the size of header of window - smartgwt

I want to increase the size of header of smartgwt.Window and insert the my own logo into the header of Window. like smartGWT Showcase windows (green color diamond with title). please see the image
Thanks in advance window custom header icon

You can set the header icon with the following code:
String iconLocation = "/testcases/resources/images/logo.png";
window.setHeaderIcon(iconLocation, 16, 16);
Regarding the height, I don't think it is possible without skinning SmartGWT, and that is not a trivial task. Besides, it could even hurt your L&F if you don't modify all the Window's header elements to accommodate to the new height. Unless this is a non-refusable requirement, I would suggest you use an icon that fits in the 20px header height.

Related

AutoLayout dynamic spacing?

I'm pretty new to the whole autolayout design and I'm trying to figure out the best way to make this design compatible on all sizes. I can't seem to find a way to space out each element so the size of each element changes according to the screen size. I know that I can constrain the subviews to the margin but Xcode seems to require a set width and height so the larger screen version ends up looking extremely compressed. (see below) What would be the best way to handle a custom form like this? Basically I need a way to dynamically space out each element.
Each element is on its own. IE text,dividers,icons
If I understood your issue correctly then I think!you need to set leading,top,tailing and bottom space and aspect ratio if necessary for change in height of textfield to the view of which you need to increase or decrease size according to its width.

Xcode Label with long Text not properly shown

This is my first IOS app, just for training, and I got some issue with Label ,check the image
As you can See Object: Photo- Visualizing the Thomas Walther is not properly shown and some words are missing.
So How to fix it and make the string appears on multiLines if it's too long?
In your storyboard, select the UILabel and open the Attributes Inspector (in the utilities, which can be opened with the shortcut opt-command-4). You can change all the the basic properties of the UILabel here.
For multiple lines, ensure that the label height is large enough and set the Lines to 0. You can also change the font scaling in the Autoshrink property (default is fixed font size).
I can't really tell from your screenshot, but you may have some Auto Layout issues with the width of your label to the right side of the window. So you may want to look into setting Auto Layout constraints as well.

UILabel that has unnecessary padding in a cell

I'm trying to make a Facebook clone for practicing iOS and I can't see why a label I have on my news feed gets unnecessary padding.
It only occurs on some labels, others on my news feed turn out fine. However for a select few there's a block of white pace above and below. At first I thought it was an alignment issue so I changed the labels background to green to show that the constraints hold out.
Anyone know as to why it's placing the padding, only for a select few?
By default UILabel will center its content vertically. Therefore, if label.bounds.size.height is greater than size of the text, the label's instinct is to center the content vertically, which will results in the vertical padding that you see in the attached image. Ensure that the label's height is being set according to the height of the text it contains and the problem should go away.
As dbart pointed out your label's frame is likely higher than the text needed. You can fix this by calling -sizeToFit. You can also check the amount of space the label is actually using for text by using +textRectWithBounds:maximumNumberOfLines:
If your cell is using autolayout to determine the height of the label you should set the preferredmaxlayoutwidth to an appropriate value (for example table width) before laying out the cell.

Why does the label control element does not wrap onto multiple lines after I select that option

I have a long label that spans multiple lines and I can not get it to wrap the text. I selected 5 lines and wrap-text option, but for some reason it is not happening. Any idea how to do that? :)
I am attaching the screen shot.
When you paste text into a label, interface builder automatically makes it wide enough to accomodate the text. Just resize your label to a smaller width; easiest to do in the size inspector on the right (the ruler icon). Try a width of 300px.

Reposition images within view based on size of text - iOS

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

Resources