Tuesday, 15 January 2013

objective c - Custom keyboard buttons iOS -


I am trying to set a highlight position for keyboard buttons, but there are some problems with it:

  1. I can not set the backgroundImage under spaceButton Image , so it's like the image below shift_1 Will not overlap (button is taped).
  2. I can not set the layer margin so that there is one place from the bottom and the second button, and at the same time that vacancy works as that button.

Below is my code:

  [self.spaceButton setImage: [UIImage imageNamed: @ "shift_1"] forState: UIControlStateNormal]; [Self. Space Button setbackground display: [keyboardviewcountor imageform color: [UIColor colorWithWhite: 0.4 alpha: 0.5]] forState: UIControlStateHighlighted]; Self.spaceButton.layer.cornerRadius = 7.0; Self.spaceButton.layer.masksToBounds = Yes;  

If someone can help me then I would be very grateful.

Enter image details here

< Div class = "post-text" itemprop = "text">

You have two ways:

From the image : Just below, left Add a transparent pixel to the right image and create a new image, then set that image as a background button.

by imageEdgeInsets : Use the set button imageEdgeInsets and the image property for the image Do (Highlight / Normal Position).


No comments:

Post a Comment