Details

      Description

      {html}<div><p>This has been a thorn in the side for many (myself included) for
      awhile: See <a href=
      "http://developer.appcelerator.com/questions/search/button%20backgroundcolor">
      http://developer.appcelerator.com/questions/search/button%20backgro...</a></p>
      <p>Here's a testcase to reproduce. It doesn't work both if the
      button is on the navBar and if it is just in the window. In the
      window..the color is set on the edges around the button (which is
      not what 99.9% of people want I'd think </p>
      <pre>
      <code class="javascript">var win = Ti.UI.currentWindow;

      var btn1 = Titanium.UI.createButton({
      title:"Test",
      backgroundColor:'#0d8d00',
      width:70,
      });
      win.rightNavButton = btn1;

      var btn2 = Titanium.UI.createButton({
      title:"Test",
      backgroundColor:'#0d8d00',
      width:70,
      height:120
      });
      win.add(btn2);</code>
      </pre>
      <p>Blain: I'm not sure of the ticket triage procedure at
      Appcelerator, so I assigned it to you as it is an iphone related
      bug. If this isn't right, sorry about that. (I just didn't want it
      to langish around.)</p></div>{html}

        Activity

        Hide
        Robby added a comment -
        {html}<div><p>Oh, one more thing. This was tested with 1.4.0, and with the
        9/2/2010 nightly.</p></div>{html}
        Show
        Robby added a comment - {html}<div><p>Oh, one more thing. This was tested with 1.4.0, and with the 9/2/2010 nightly.</p></div>{html}
        Hide
        Robby added a comment -
        {html}<div><p>And setting backgroundImage: 'none' fixed the main window
        button, but not the navbar button. In any case, it's a hack. </p></div>{html}
        Show
        Robby added a comment - {html}<div><p>And setting backgroundImage: 'none' fixed the main window button, but not the navbar button. In any case, it's a hack. </p></div>{html}
        Hide
        Stephen Tramer added a comment -
        {html}<div><p>Ticket is still valid. Test in bugtests.</p></div>{html}
        Show
        Stephen Tramer added a comment - {html}<div><p>Ticket is still valid. Test in bugtests.</p></div>{html}
        Hide
        Brian added a comment -
        {html}<div><p>Seriously. How has this not been fixed yet? It still doesn't
        work in 1.6 or the latest nightly 1.6.1</p></div>{html}
        Show
        Brian added a comment - {html}<div><p>Seriously. How has this not been fixed yet? It still doesn't work in 1.6 or the latest nightly 1.6.1</p></div>{html}
        Hide
        Norm added a comment -
        {html}<div><p>Bump for this also - rather silly this doesn't just "work" -
        rather core to the way buttons behave.</p></div>{html}
        Show
        Norm added a comment - {html}<div><p>Bump for this also - rather silly this doesn't just "work" - rather core to the way buttons behave.</p></div>{html}
        Hide
        Blain Hamon (Inactive) added a comment -
        {html}<div><p>Trying to clarify here: do you mean a rounded rectangle button,
        and how background color defines the corners behind the rounded
        rectangle, and not the rectangle itself? If so, that actually is
        Apple's design. Included (And hopefully Lighthouse will actually
        keep it) is an example outside of Titanium, in Apple's own
        Interface Builder.</p>
        <p>In order to have a custom look to a button, you'll have to use a
        background image. Take a look at the button example in Kitchen
        Sink, namely the section that goes
        <code>Titanium.UI.createButton({backgroundImage:'../images/BUTT_grn_off.png', backgroundSelectedImage:'../images/BUTT_grn_on.png', backgroundDisabledImage: '../images/BUTT_drk_off.png'})</code>
        .</p>
        <p>With regards to the nav bar, the class behind that (when no
        custom background image is used) is UIBarButtonItem. As per
        <a href="http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIBarButtonItem_Class/Reference/Reference.html%23//apple_ref/doc/uid/TP40007519">
        http://developer.apple.com/library/ios/#documentation/UIKit/Referen...</a>
        , there's only three styles for a barButtonItem:</p>
        <p>Plain: In the nav bar, this is treated as bordered.<br>
        Bordered: The background color is determined by the tint of the
        navbar containing it. This is not editable.<br>
        Done: The background color is blue, like a Done button. This color
        is not editable.</p>
        <p>Again, for a custom button style, use a backgroundImage.</p></div>{html}
        Show
        Blain Hamon (Inactive) added a comment - {html}<div><p>Trying to clarify here: do you mean a rounded rectangle button, and how background color defines the corners behind the rounded rectangle, and not the rectangle itself? If so, that actually is Apple's design. Included (And hopefully Lighthouse will actually keep it) is an example outside of Titanium, in Apple's own Interface Builder.</p> <p>In order to have a custom look to a button, you'll have to use a background image. Take a look at the button example in Kitchen Sink, namely the section that goes <code>Titanium.UI.createButton({backgroundImage:'../images/BUTT_grn_off.png', backgroundSelectedImage:'../images/BUTT_grn_on.png', backgroundDisabledImage: '../images/BUTT_drk_off.png'})</code> .</p> <p>With regards to the nav bar, the class behind that (when no custom background image is used) is UIBarButtonItem. As per <a href="http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIBarButtonItem_Class/Reference/Reference.html%23//apple_ref/doc/uid/TP40007519"> http://developer.apple.com/library/ios/#documentation/UIKit/Referen ...</a> , there's only three styles for a barButtonItem:</p> <p>Plain: In the nav bar, this is treated as bordered.<br> Bordered: The background color is determined by the tint of the navbar containing it. This is not editable.<br> Done: The background color is blue, like a Done button. This color is not editable.</p> <p>Again, for a custom button style, use a backgroundImage.</p></div>{html}
        Hide
        Reggie Seagraves added a comment -
        {html}<div><p>Marking as invalid. Blain has explained how to the client can
        implement custom button UI.</p></div>{html}
        Show
        Reggie Seagraves added a comment - {html}<div><p>Marking as invalid. Blain has explained how to the client can implement custom button UI.</p></div>{html}
        Hide
        dit k added a comment -

        setting Image, color etc.. is very buggy and still not fixed

        Show
        dit k added a comment - setting Image, color etc.. is very buggy and still not fixed

          People

          • Assignee:
            Blain Hamon (Inactive)
            Reporter:
            Robby
          • Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development