Friday, October 25, 2013

Header Panel not working correctly on Ipad

Hi there,

I am new to GWT and try to make use of the HeaderPanel for my app.
However that panel does not work as expected on my IPad,
As soon as I load the application in landscape mode the header widget is only partially displayed. For example if it contains a button you see only half of it (see example below).

I also tried the following magic line in my html-file, but that didnt do the trick:<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>

I understand when targetting mobile devices one should consider using mgwt, but honestly I'm afraid there'll be similar problems. At least when looking at the ButtonBar section of the showcase demo my IPad behaves in a similar way: it looks good in portrait mode, but parts of the top bar get cut off when switching to landscape mode.

Any ideas or hints?

Cheers,
Manoula.


PS: Here goes my sample code:

public class HeaderPanelDemo implements EntryPoint {
/**
* The message displayed to the user when the server cannot be reached or
* returns an error.
*/
private static final String SERVER_ERROR = "An error occurred while "
+ "attempting to contact the server. Please check your network "
+ "connection and try again.";

/**
* Create a remote service proxy to talk to the server-side Greeting service.
*/
private final GreetingServiceAsync greetingService = GWT
.create(GreetingService.class);

/**
* This is the entry point method.
*/
public void onModuleLoad() {
final Button sendButton = new Button("Send");
final TextBox nameField = new TextBox();
nameField.setText("GWT User");
final HeaderPanel hpn = new HeaderPanel();
final HorizontalPanel topPn = new HorizontalPanel();
final HorizontalPanel bottomPn = new HorizontalPanel();
final SimpleLayoutPanel simplePn = new SimpleLayoutPanel();
topPn.add(sendButton);
bottomPn.add(nameField);
hpn.setHeaderWidget(topPn);
hpn.setContentWidget(simplePn);
hpn.setFooterWidget(bottomPn);
RootLayoutPanel.get().add(hpn);
}
}

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment