{ "id": "171561", "key": "TIMOB-25985", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "20238", "description": "", "name": "Release 7.5.0", "archived": false, "released": true, "releaseDate": "2018-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-06-21T14:42:45.000+0000", "created": "2018-04-24T08:00:15.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "ios" ], "versions": [], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2018-09-28T14:23:04.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" }, { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "In my apps i use font-icons for:\r\n- title of buttons\r\n- text of label\r\n\r\n*Example:*\r\n{code}\r\nvar IconicFont = require('IconicFont');\r\nvar Icons = new IconicFont({\r\n\tfont: 'listIcons'\r\n});\r\nvar btn = Ti.UI.createButton({\r\n\theight : 50,\r\n width : 50,\r\n\tcolor: 'white',\r\n\tfont: {\r\n\t\tfontSize: 24,\r\n\t\tfontFamily: Icons.fontfamily\r\n\t},\r\n\ttitle: Icons.icon(\"add\"),\r\n\ttextAlign: Ti.UI.TEXT_ALIGNMENT_CENTER,\r\n\tverticalAlign: Ti.UI.TEXT_VERTICAL_ALIGNMENT_CENTER,\r\n});\r\n{code}\r\n\r\nIf the user active this option _Settings / General / Accessibility / Button Shapes_ , the result is the attached image, an underline on every buttons. I know this is normal, but i would like to know if it was possible to disable this effect.\r\n\r\nI tried to active this option *accessibilityHidden*, but without result.\r\nI also thought about using the *attributeString* (with the param [Titanium.UI.ATTRIBUTE_UNDERLINE_STYLE_NONE|http://docs.appcelerator.com/platform/latest/#!/guide/Attributed_Strings-section-src-37538231_AttributedStrings-Underline]), but it's only for _Label_, _TextArea_ or _TextField_.\r\n\r\nInfo link1: [https://stackoverflow.com/questions/23246543/remove-underline-on-uibutton-in-ios-7|https://stackoverflow.com/questions/23246543/remove-underline-on-uibutton-in-ios-7]\r\nInfo link2: [https://developer.apple.com/documentation/uikit/accessibility/uiaccessibility]", "attachment": [ { "id": "65080", "filename": "Schermata 2018-04-24 alle 09.40.58.png", "author": { "name": "nicolomonili", "key": "nicolomonili", "displayName": "nicolomonili", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-04-24T07:43:08.000+0000", "size": 30161, "mimeType": "image/png" } ], "flagged": false, "summary": "TiAPI: Disable accessibility features on Ti.UI.Button by using AttributedString", "creator": { "name": "nicolomonili", "key": "nicolomonili", "displayName": "nicolomonili", "active": true, "timeZone": "Europe/Rome" }, "subtasks": [], "reporter": { "name": "nicolomonili", "key": "nicolomonili", "displayName": "nicolomonili", "active": true, "timeZone": "Europe/Rome" }, "environment": null, "comment": { "comments": [ { "id": "437099", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thanks for raising this! You could expose the native {{attributedTitleForState:}} API in the SDK and we'd be happy to review it. Moving to TIMOB to track this.\r\n\r\n*EDIT*: You could try to:\r\n1. Add the following to your TiUIButton.m\r\n{code:objc}\r\n- (void)setAttributedString_:(id)arg\r\n{\r\n#ifdef USE_TI_UIATTRIBUTEDSTRING\r\n ENSURE_SINGLE_ARG(arg, TiUIAttributedStringProxy);\r\n [[self proxy] replaceValue:arg forKey:@\"attributedString\" notification:NO];\r\n [[self button] setAttributedTitle:[arg attributedString] forState:UIControlStateNormal];\r\n [(TiViewProxy *)[self proxy] contentsWillChange];\r\n#endif\r\n}\r\n{code}\r\n2. Add the TiUIAttributedString import to the top of the file:\r\n{code:objc}\r\n#ifdef USE_TI_UIATTRIBUTEDSTRING\r\n#import \"TiUIAttributedStringProxy.h\"\r\n#endif\r\n{code}\r\n3. Use the new property \"attributedString\" on the button and pass a well configured Ti.UI.AttributedString instance.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-04-24T10:55:43.000+0000", "updated": "2018-04-24T11:04:13.000+0000" }, { "id": "437102", "author": { "name": "nicolomonili", "key": "nicolomonili", "displayName": "nicolomonili", "active": true, "timeZone": "Europe/Rome" }, "body": "I have to modify this file _Appcelerator Workspace / App Name / build / iphone / Classes / TiUIButton.m_ or this one _User / Library / Application Support / Titanium / mobilesdk / osx / SDK_VERSION / iphone / Classes / TiUIButton.m_ ?", "updateAuthor": { "name": "nicolomonili", "key": "nicolomonili", "displayName": "nicolomonili", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-04-24T11:21:04.000+0000", "updated": "2018-04-24T11:26:10.000+0000" }, { "id": "437104", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "What do you think? ;-) Spoiler: It's the Application Support one, since the build directory is flushed on clean builds.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-04-24T11:37:38.000+0000", "updated": "2018-04-24T11:37:38.000+0000" }, { "id": "437105", "author": { "name": "nicolomonili", "key": "nicolomonili", "displayName": "nicolomonili", "active": true, "timeZone": "Europe/Rome" }, "body": "Yes, i understood it while i was writing. I'm doing some tests ..", "updateAuthor": { "name": "nicolomonili", "key": "nicolomonili", "displayName": "nicolomonili", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-04-24T11:38:52.000+0000", "updated": "2018-04-24T11:38:52.000+0000" }, { "id": "437107", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I am still not sure it solves it for you. Here is my test case:\r\n{code:js}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n\r\nvar text = '';\r\n\r\nvar attr = Titanium.UI.createAttributedString({\r\n text: text,\r\n attributes: [\r\n // Remove underline\r\n {\r\n type: Titanium.UI.ATTRIBUTE_UNDERLINES_STYLE,\r\n value: Ti.UI.ATTRIBUTE_UNDERLINE_STYLE_NONE,\r\n range: [0, text.length]\r\n }\r\n ]\r\n});\r\n\r\nvar btn = Ti.UI.createButton({\r\n attributedString: attr,\r\n textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER\r\n});\r\n\r\nwin.add(btn);\r\nwin.open();\r\n{code}\r\nHow can I enable the underlines as part of accessibility?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-04-24T11:41:13.000+0000", "updated": "2018-04-24T11:41:13.000+0000" }, { "id": "437108", "author": { "name": "nicolomonili", "key": "nicolomonili", "displayName": "nicolomonili", "active": true, "timeZone": "Europe/Rome" }, "body": "_Settings / General / Accessibility / Button Shapes_", "updateAuthor": { "name": "nicolomonili", "key": "nicolomonili", "displayName": "nicolomonili", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-04-24T11:43:50.000+0000", "updated": "2018-04-24T11:43:50.000+0000" }, { "id": "437109", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Works like a charm :-).", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-04-24T11:45:38.000+0000", "updated": "2018-04-24T11:45:38.000+0000" }, { "id": "437111", "author": { "name": "nicolomonili", "key": "nicolomonili", "displayName": "nicolomonili", "active": true, "timeZone": "Europe/Rome" }, "body": "I can confirm, this edit works!\r\n\r\nBy applying _Titanium.UI.ATTRIBUTE_UNDERLINES_STYLE_ it's possible to remove the underline effect added by the accessibility features -> Settings / General / Accessibility / Button Shapes\r\n", "updateAuthor": { "name": "nicolomonili", "key": "nicolomonili", "displayName": "nicolomonili", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-04-24T12:03:23.000+0000", "updated": "2018-04-24T12:04:04.000+0000" }, { "id": "437112", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Cool! I will prepare a pull request and schedule it for 7.3.0.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-04-24T12:04:52.000+0000", "updated": "2018-04-24T12:04:52.000+0000" }, { "id": "437115", "author": { "name": "nicolomonili", "key": "nicolomonili", "displayName": "nicolomonili", "active": true, "timeZone": "Europe/Rome" }, "body": "I was hoping for the next release .. I'll wait, thanks!", "updateAuthor": { "name": "nicolomonili", "key": "nicolomonili", "displayName": "nicolomonili", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-04-24T12:26:14.000+0000", "updated": "2018-04-24T12:26:14.000+0000" }, { "id": "437136", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "The next release is already closed for new features. I have added Android parity as well, so it will be worth waiting.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-04-25T12:54:43.000+0000", "updated": "2018-04-25T12:54:43.000+0000" }, { "id": "437137", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/10010", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-04-25T13:00:25.000+0000", "updated": "2018-04-25T13:00:25.000+0000" }, { "id": "438591", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~nicolomonili] The new feature was just added to master (7.4.0), have fun! And it was not moved from 7.3.0 to 7.4.0, but 7.4.0 is basically the new 7.3.0 because 7.2.0 squezzed in for GDPR compliance.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-06-21T14:43:57.000+0000", "updated": "2018-06-21T14:43:57.000+0000" }, { "id": "440915", "author": { "name": "nicolomonili", "key": "nicolomonili", "displayName": "nicolomonili", "active": true, "timeZone": "Europe/Rome" }, "body": "So, it's in the actual 7.3.0.G.A ?", "updateAuthor": { "name": "nicolomonili", "key": "nicolomonili", "displayName": "nicolomonili", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-08-21T07:46:30.000+0000", "updated": "2018-08-21T07:46:30.000+0000" }, { "id": "440916", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "it's in the \"new new\" 7.4.0, because it was moved out to make place for more critical bugs. The capacity of the quality engineering team is limited, so we wanted to focus on Android in that release. ", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-08-21T07:48:55.000+0000", "updated": "2018-08-21T07:48:55.000+0000" }, { "id": "442162", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket.* Verified fix in SDK Version {{7.5.0.v20180927102615}} Able to disable accessibility features on Ti.UI.Button by using {{AttributedString}}.\r\n\r\n*FR Passed (Test Steps)*\r\n# Created a new Titanium application \r\n# Added the test case above by Hans in to the {{app.js}}\r\n# Ran the program \r\n# Unable to see the button have an underline \r\n# Uncommented {{ Ti.UI.ATTRIBUTE_UNDERLINE_STYLE_NONE}}\r\n# Able to see the underline again\r\n\r\n*Test Environment*\r\n{code:java}\r\nAPPC Studio: 5.1.0.201808080937\r\niPhone 6 (12.0)\r\nAPPC CLI: 7.0.7-master.4\r\nOperating System Name: Mac OS Mojave\r\nOperating System Version: 10.14\r\nNode.js Version: 8.9.1\r\nXcode 10.0\r\n{code}\r\n", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-09-28T14:22:52.000+0000", "updated": "2018-09-28T14:22:52.000+0000" } ], "maxResults": 16, "total": 16, "startAt": 0 } } }