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

iOS: "font" property does not return to default when set to null or {}

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: Release 3.1.1
    • Fix Version/s: Release 6.2.0
    • Component/s: iOS
    • Labels:
    • Environment:

      TiSDK 3.1.1
      iOS 6.1

      Description

      problem

      When setting the font property of a Ti.UI.Label to null or {}, the font of the Label does not return to the default font which is used when no font property is defined. It instead is set to a font slightly smaller than the default font. This is best seen by running the test case below.

      This is an issue for Alloy as it relies on the ability to "reset" Titanium proxy properties in order to remove/reset style classes at runtime. In its current state, this could potentially create unexpected visual results on iOS.

      expected

      When I set the the font property of a Ti.UI.Label to null or {}, the font of the Label should return to its default state. This is what occurs on Android and Mobileweb.

      test case

      app.js

      var win = Ti.UI.createWindow({
      	backgroundColor: '#fff',
      	modal: false,
      	exitOnClose: true
      });
      var label = Ti.UI.createLabel({
      	text: 'just a test label'
      });
       
      // Clicking the label will show that on iOS a slightly smaller font is used when
      // the label is re-rendered with font=null. All other platforms use the same default
      // font.
      label.addEventListener('click', function(e) {
      	label.font = null;
      });
       
      win.add(label);
      win.open();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hknoechel Hans Knöchel
                Reporter:
                tlukasavage Tony Lukasavage
                Reviewer:
                Vijay Singh
                Tester:
                Samir Mohammed
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code