Re: Maintaining Image for a UIButton

  • On Mon, 09 Jan 2012 17:12:17 -0800 (PST), R <r4eemesa...> said:
    > This is easy in OSX and bindings.  But how do I maintain the aspect
    > ratio of an UIImage place in a UIButton... via [myButton setImage...]
    > or [myButton setBackgroundImage...].
    >

    Use Core Graphics to draw your image to the desired size and aspect ratio *before* you put it in the button. m.

    --
    matt neuburg, phd = <matt...>, <http://www.apeth.net/matt/>
    A fool + a tool + an autorelease pool = cool!
    Programming iOS 4!
    http://www.apeth.net/matt/default.html#iosbook
  • Solution found.... stop using backgroundImage for the button.  Use
    just image.  Grabbed the button's imageView and applied contentMode.
    All now happy.  Still not sure difference between the button's image
    and backgroundImage.  It appears that the background image does not
    use the button's imageView wrapper.

    On Jan 19, 9:09 am, Matt Neuburg <m......> wrote:
    > On Mon, 09 Jan 2012 17:12:17 -0800 (PST), R <r4eem......> said:
    >
    >> This is easy in OSX and bindings.  But how do I maintain the aspect
    >> ratio of an UIImage place in a UIButton... via [myButton setImage...]
    >> or [myButton setBackgroundImage...].
    >
    > Use Core Graphics to draw your image to the desired size and aspect ratio *before* you put it in the button. m.
    >
    > --
    > matt neuburg, phd = <m......>, <http://www.apeth.net/matt/>
    > A fool + a tool + an autorelease pool = cool!
    > Programming iOS 4!http://www.apeth.net/matt/default.html#iosbook
previous month january 2012 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today