Jump to content
IElite

Using SetBounds to manually layout crontrols

Recommended Posts

When I use SetBounds to layout out my controls, it works great within SMS built in browser.  However, when I build my project with phonegap and test it on my android phone, it does not.  (also doesn't look right in any other browser I try outside of SMS).

 

 


 

 


 

example code

 


procedure TfrmQuestion.Resize;
begin
  inherited;
  if not (Handle.Valid and (csReady in ComponentState)) then
    Exit;
  fHeader.SetBounds(0,0,width,50);
  fQuestion.SetBounds(0,50,ClientWidth,ClientHeight-100);
  fFooter.SetBounds(0,ClientHeight-50,ClientWidth,50);
end;



Don't even get me going on SmartCL.Layout, cause it is even worse on the android :)

 

I should note, that I do use the following code for capturing the orientation change

 

 



function window: variant; external 'window' property;


procedure TfrmQuestion.InitializeObject;
begin
  inherited;
  {$I 'Question:impl'}
  window.addEventListener('devicemotion', @Resize, false);
end;

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×