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

Android: borderRadius does not adhere to defaultunit

    Details

      Description

      The borderRadius property does not adhere to the default unit set in tiapp.xml. Both borderWidth and borderRadius only accept Number, so it's not possible to workaround by explicitly setting the unit. Like most other dimension-related properties (except fontSize as far as I know) borderWidth does use the default unit.

      To reproduce

      1. Create a new app
      2. Replace the code in app.js by:

            var w = Ti.UI.createWindow({
                backgroundColor: 'white',
                modal: false
            });
            var v = Ti.UI.createView({
                backgroundColor: 'red',
                borderRadius: 150,
                width: 300,
                height: 300,
                borderWidth: 100,
                borderColor: 'black'
            });
            w.add(v);
            w.open();
            

      3. Run the app on both iOS and Android and the result will be like screenshots 1 and 2.
      4. Now set the default unit to dp by adding this to the tiapp.xml:

            <property name="ti.ui.defaultunit" type="string">dp</property>
            

      5. Run the app on both platforms again and the result will be like screenshots 1 and 3. As you can see because of the DPI of the tested device the border radius is about half of what we expected.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sunila Sunila
                Reporter:
                fokkezb Fokke Zandbergen
                Reviewer:
                Hieu Pham
              • Watchers:
                0 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Integration