Hey,
That's the first time I'm trying to contribute to Titanium SDK and I want to enable the SDK to put images on the background of the listViewActionRow.
When you swipe left if opens what you have set up on your 'editActions' component.
Today this component only accepts the following properties:
* color
* identifier
* style
* title
I'd like to have the property "image" there as well and once you set it shows the image in the background of the "button".
This is possible to create and I've forked the Titanium SDK framework and made a test (Check the TODO comments):
https://github.com/xicovarisco/titanium_mobile/commit/b4ce3930023eebed5f9f20f465a6da6a9a1f4249
In this case I've changed the file 'TiUIListView.m' in accordance with this post:
http://stackoverflow.com/questions/29421894/uitableviewrowaction-image-for-title
The result can be found in the attachment.
The only thing I'm not sure how you guys deal with is:
* Should I get this image as a property like the other items? (e.g. TiColor* color = [TiUtils colorValue:@"color" properties:prop]; )
* If so, I saw that you don't have a method called
imageValue
on your TiUtils file. Should we create it?
If we sort this out we can easily release this new feature to everyone else. I'm sure everyone will appreciate it.
Looks great Francisco - can't wait to use this feature.
Cool idea. Here is a hint on the [possible implementation](https://github.com/appcelerator/titanium_mobile/compare/master...hansemannn:TIMOB-24264?expand=1). Some general problems with this idea: - The image uses a pattern, so smaller images are always repeated - The width of the action is determined by the title, so without a "blank title" it looks odd - You cannot set the
color
property when using theimage
property because it would override it (actually fixed that with a hack in [this commit](https://github.com/hansemannn/titanium_mobile/commit/10f02d01c6e87726f335e4144f3dcf59a012465b)) This are native problems, not Titanium-specific ones. Example:!Simulator Screen Shot 29 Dec 2016, 12.05.26.png|thumbnail!
That's good @hans. Some thoughts: 1) I don't think it would be a problem to ask Titanium developer to put "blank titles" if they want to use images on editActions. (As long as we have it documented well) 2) We could create a hacky way to input blank characters to the title if the developer doesn't set the property 'title' (We could calculate the image size and based on some algorithm we input the blank spaces to fit the image), but I don't think this is a good solution, because we will be going against what Apple provides us today. I would stick to what we can do. 3) Probably in the future Apple will revise this API and change some things to make it more "maintainable" for developers, and when this happens we better not have it hacked. Other problem I found with this solution: 1) The image needs to have all the specific-sizes (@2x, @3x) to get it to work, otherwise it doesn't load the image. (I'm not sure if this is an Apple restriction for it or a Titanium-specific stuff) I'll create a pull request with the code you have created. Thanks