Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-11949

iOS: Label backgroundImage not set correctly on creation

    Details

      Description

      Following a pull request of mine, a regression appeared. Setting backgroundImage on creation was not working.
      This is due to the fact that the layer was not created.

      var win = Ti.UI.createWindow({backgroundColor:'white'});
       
      var label = Ti.UI.createLabel({
      	width:100,
      	height:60,
      	top:50,
      	left:10,
      	text:'This is a test',
      	backgroundPaddingTop:20,
      	backgroundPaddingLeft:20,
      	backgroundPaddingRight:20,
      	backgroundImage:'KS_nav_UI.png'
      })
      win.add(label);
       
      var b3 = Titanium.UI.createButton({
      	title:'animate',
      	height:40,
      	width:200,
      	bottom:10
      });
      var small = false;
      b3.addEventListener('click', function()
      {
      	if (!small)
      		label.animate({
      			width:140,
      			height:25,
      			top:10,
      			left:40
      		});
      	else
      		label.animate({
      			width:100,
      		height:60,
      		top:50,
      		left:10
      		});
      	small = !small;
      });
      win.add(b3);
      win.open();
      

      Now the label doesnt have a custom bgd layer. Instead it uses the TiUIView bgd layer.
      And it overloads the method used to set the frame of the bgd layer to add padding

      The example shows that setting the background image works on creation. But also that the new implementation didnt break padding, even with animations.

        Attachments

          Activity

            People

            • Assignee:
              vduggal Vishal Duggal (Inactive)
              Reporter:
              farfromrefuge Martin Guillon (Inactive)
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-15089
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code