autoresize

Java JTextArea that auto-resizes and scrolls

倾然丶 夕夏残阳落幕 提交于 2019-12-23 07:01:24
问题 I have a JTextArea in a JPanel. How can I have the JTextArea fill the whole JPanel and resize when the JPanel resizes and scroll when too much text is typed in? 回答1: JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); //give your JPanel a BorderLayout JTextArea text = new JTextArea(); JScrollPane scroll = new JScrollPane(text); //place the JTextArea in a scroll pane panel.add(scroll, BorderLayout.CENTER); //add the JScrollPane to the panel // CENTER will use up all available

How can I create a resizeable text area in Sencha Touch?

雨燕双飞 提交于 2019-12-23 03:21:33
问题 I have an application in Sencha Touch where I have a textareafield. In Chrome, this is resizeable, but not when using an iPhone (I haven't tried on an Android device). I need to have a text input area where people can enter text anything from one or two words long to many sentences. So I need this to either automatically resize ; have some way of manually resizing it; or some way of scrolling within it. So far I have been unable to do any of these with Sencha Touch. I would really appreciate

Resizing UINavigationBar on rotation

梦想的初衷 提交于 2019-12-22 04:46:07
问题 I have a subclass of UIViewController which handles a UIView. The viewcontroller is presented modally (it slides up from the bottom of the screen). At the top of the view, i have added a navigation bar. Note that this bar is not handled by a navigation controller. I want to get the navbar to shrink in height when the view rotates to landscape (similar to how it behaves when it is handled by a UINavigationController). However, I can't set its autoresizing mask to flexible height in IB, and

swift: programmatically create UILabel fixed width that resizes vertically according to text length

橙三吉。 提交于 2019-12-21 09:33:57
问题 I've seen answers to vertical resizing that involve autolayout, but the UILabel s I'm creating are only needed at runtime. (I might need anywhere from zero to many of these labels.) Examples (ignore the color) Short text (note same width as longer text): Longer text (note same width as shorter text example with more lines for add'l text): If the text can fit in one line of fixed width, the label shouldn't need to resize vertically. But if there are more characters, the label should keep

iOS8 MKMapView Framebuffer error during rotation when autoresize is applied

纵饮孤独 提交于 2019-12-20 14:43:32
问题 #import "AppDelegate.h" #import <MapKit/MapKit.h> @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions { [self setWindow:[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]]; [self.window makeKeyAndVisible]; UIViewController *vc = [[UIViewController alloc] init]; self.window.rootViewController = vc; vc.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

iOS8 MKMapView Framebuffer error during rotation when autoresize is applied

送分小仙女□ 提交于 2019-12-20 14:43:10
问题 #import "AppDelegate.h" #import <MapKit/MapKit.h> @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions { [self setWindow:[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]]; [self.window makeKeyAndVisible]; UIViewController *vc = [[UIViewController alloc] init]; self.window.rootViewController = vc; vc.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

Auto-resizing skewed background in CSS (+ images?)

泪湿孤枕 提交于 2019-12-20 12:21:51
问题 I'm going to convert this PSD image to CSS. I've multiple h2s in multiple pages, so the inner text lenght and background-color may vary. Therefore the background should automatically adapt to "any" length. So far, the markup is something like: <h2 class="sub-heading lab-heading">Laboratori</h2> I may eventually wrap the inner text into a <span> , but keeping a semantic valid markup without any additional element would be ♥ly. The inner text is rotated, but it's not mandatory. What i'm

Dynamically resize QIcon without calling setSizeIcon()

我与影子孤独终老i 提交于 2019-12-20 02:50:56
问题 I'm currently struggling with what should be an easy issue to solve. Many widgets support some sort of QSizePolicy . This includes the QPushbutton . In my case I have multiple buttons in a grid layout all of which have their QSizePolicy for both vertical and horizontal resizing set to expanding . This leads to the nead result of the buttons being resized according to the size of the widget which the grid layout is part of. The problem comes from the way icons seem to be handled in Qt. QIcon

How to resize font-size proportionally to div size

孤人 提交于 2019-12-19 19:59:08
问题 I'm trying to create a website where the pages resize to the windows size on the fly. While we can get images and such to resize automatically as a % of the div size. We do not seem to be able to resize the text within a div to a relative % of the container. This feature would need to work as the browser window itself is resized, without having to refresh the page. The site is basic and is using js,css, html. The simplest method possible would be appreciated, but any solution is fantastic.

iPhone - Auto resizing UIWebView content do not fit the frame

故事扮演 提交于 2019-12-18 10:23:06
问题 I'm generating an UIWebView into my viewDidLoad method, with a tiny size (let's say something like 50x70). And then I put it into a super UIView. I'd like to make its content fit the webView frame. To do this, I wrote : oneView = [[UIWebView alloc] initWithFrame:CGRectMake(x, y, W, H)]; oneView.backgroundColor = [UIColor whiteColor]; oneView.autoresizingMask = UIViewAutoresizingFlexibleWidth; oneView.scalesPageToFit = YES; oneView.autoresizesSubviews = YES; [self.view addSubview:oneView];