iPhone UIWebView width does not fit after zooming operation + UIInterfaceOrientation change

I found something that worked for me. The problem is that when uiwebview changes its orientation web contents are zoommed to fit with viewport. But zoomscale parameter of scrollview subview is not updated correctly (nor are updated minimumZoomScale nor maximumZoomScale Then we need to do it manually at willRotateToInterfaceOrientation: – (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { CGFloat ratioAspect … Read more

How to resize Title in a navigation bar dynamically

Used the below code in ViewDidload . Objective C self.title = @”Your TiTle Text”; UILabel* tlabel=[[UILabel alloc] initWithFrame:CGRectMake(0,0, 200, 40)]; tlabel.text=self.navigationItem.title; tlabel.textColor=[UIColor whiteColor]; tlabel.font = [UIFont fontWithName:@”Helvetica-Bold” size: 30.0]; tlabel.backgroundColor =[UIColor clearColor]; tlabel.adjustsFontSizeToFitWidth=YES; tlabel.textAlignment = NSTextAlignmentCenter; self.navigationItem.titleView=tlabel; Swift Version self.title = “Your Title Text” let tlabel = UILabel(frame: CGRect(x: 0, y: 0, width: 200, height: … Read more

How to automatic resize tinyMCE?

Nowadays, you should use the autoresize plugin that comes with tinyMCE. You will have to call tinyMCE like this (jQuery version): $(‘.tinymce’).tinymce({ theme : ‘advanced’, plugins : ‘autoresize’, width: ‘100%’, height: 400, autoresize_min_height: 400, autoresize_max_height: 800, }); I made the experience, that it may be helpful to manually call the resizing in the init_instance_callback to … Read more

How to create a self resizing grid of buttons in tkinter?

You need to configure the rows and columns to have a non-zero weight so that they will take up the extra space: grid.columnconfigure(tuple(range(60)), weight=1) grid.rowconfigure(tuple(range(30)), weight=1) You also need to configure your buttons so that they will expand to fill the cell: btn.grid(column=x, row=y, sticky=”news”) This has to be done all the way up, so … Read more

Android: why is there no maxHeight for a View?

None of these solutions worked for what I needed which was a ScrollView set to wrap_content but having a maxHeight so it would stop expanding after a certain point and start scrolling. I just simply overrode the onMeasure method in ScrollView. @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { heightMeasureSpec = MeasureSpec.makeMeasureSpec(300, MeasureSpec.AT_MOST); super.onMeasure(widthMeasureSpec, heightMeasureSpec); … Read more

How to resize an image when resizing the window in JavaFX

Applying the solution to JavaFx image resizing to your sample code and resizing the window results in different image sizes for me. import javafx.application.Application; import javafx.beans.property.*; import javafx.beans.value.*; import javafx.event.*; import javafx.geometry.HPos; import javafx.geometry.VPos; import javafx.scene.Scene; import javafx.scene.control.*; import javafx.scene.image.*; import javafx.scene.layout.*; import javafx.stage.Stage; public class ImageResizer extends Application { @Override public void start(Stage primaryStage) … Read more

How to get StackPanel’s children to fill maximum space downward?

It sounds like you want a StackPanel where the final element uses up all the remaining space. But why not use a DockPanel? Decorate the other elements in the DockPanel with DockPanel.Dock=”Top”, and then your help control can fill the remaining space. XAML: <DockPanel Width=”200″ Height=”200″ Background=”PowderBlue”> <TextBlock DockPanel.Dock=”Top”>Something</TextBlock> <TextBlock DockPanel.Dock=”Top”>Something else</TextBlock> <DockPanel HorizontalAlignment=”Stretch” VerticalAlignment=”Stretch” … Read more

Scale image to fit a bounding box

Thanks to CSS3 there is a solution ! The solution is to put the image as background-image and then set the background-size to contain. HTML <div class=”bounding-box”> </div> CSS .bounding-box { background-image: url(…); background-repeat: no-repeat; background-size: contain; } Test it here: http://www.w3schools.com/cssref/playit.asp?filename=playcss_background-size&preval=contain Full compatibility with latest browsers: http://caniuse.com/background-img-opts To align the div in the center, … Read more