mirror of
https://github.com/zhigang1992/rmq.git
synced 2026-04-30 21:52:33 +08:00
Merge pull request #235 from fvonhoven/master
Add ability for new iPhone sizes to resource_for_device and tests
This commit is contained in:
@@ -17,7 +17,14 @@ module RubyMotionQuery
|
||||
|
||||
# @return [UIImage]
|
||||
def resource_for_device(file_base_name, opts = {})
|
||||
resource( RMQ.device.four_inch? ? "#{file_base_name}-568h" : file_base_name, opts)
|
||||
ext = if RMQ.device.five_point_five_inch?
|
||||
"-736h"
|
||||
elsif RMQ.device.four_point_seven_inch?
|
||||
"-667h"
|
||||
elsif RMQ.device.four_inch?
|
||||
"-568h"
|
||||
end
|
||||
resource("#{file_base_name}#{ext}")
|
||||
end
|
||||
|
||||
# @return [UIImage]
|
||||
|
||||
Reference in New Issue
Block a user