Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Portrait and Landscape layouts

There there a way to position buttons by percentages instead of absolute positions? Ie how it's done in interface builder.

I tried something like this, but it crashes the app. So I guess it can't take something like '60%'

var mapButton = Titanium.UI.createButton({
title:'Map',
height:50,
width:145,
top:'60%',
left:10
});

— asked October 15th 2010 by Kim Le
  • button
  • landscape
  • layout
  • portrait
0 Comments

1 Answer

  • It may be the version of Titanium that you are using. I just tested this on a nightly build and it works fine and handles orientation as expected. What version are you using?

    — answered October 16th 2010 by John McKnight
    permalink
    2 Comments
    • I'm using 1.4.1.1. I also tired the same js code with continuous-1.4.2 and still the same crash. There isn't much logs nor stack trace. I tired debugging this through the Xcode project file in the iphone build directory.

      Is there an example of this use layout in kitchen sink?

      — commented October 16th 2010 by Kim Le
    • I am getting the same issue (iphone) the debug output says:

      Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
      mmap$UNIX2003 called from function _Z20TCMalloc_SystemAllocmPmm in image Iphone Test.
      Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
      pthread_cond_init$UNIX2003 called from function _ZN3WTI17TCMalloc_PageHeap4initEv in image Iphone Test.
      Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
      pthread_cond_wait$UNIX2003 called from function _ZN3WTI17TCMalloc_PageHeap15scavengerThreadEv in image Iphone Test.
      Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
      mprotect$UNIX2003 called from function _ZN2TI3JIT35privateCompileCTIMachineTrampolinesEPN3WTI6RefPtrINS_14ExecutablePoolEEEPNS_12TiGlobalDataEPNS_21MacroAssemblerCodePtrES9_S9S9 in image Iphone Test.

      — commented November 3rd 2010 by Jay J
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.