How to increase the ІmageButton (scale) and add a frame (stroke) when pressed (in the OnClick() method) in the MainActivity class?

  • Do you need a zoom effect or what task? What is the reason for the desire to do it programmatically, the design is not defined in advance and should be formed in the process of the program? Describe the task in more detail. - pavlofff
  • I have more than 70 icons (ImageButton) on the GridLayout, you know how they will look on small displays, the zoom is needed in order for the user to be sure that he has made the right choice, if so he has to click LongClick. I have no particular desire to write for each <selector> button, and therefore I want to solve this problem programmatically. - Oleg Pylypiv
  • one
    In a sense, for each button to write a selector, they should be different for all buttons? Usually one selector is written and assigned to all necessary buttons. As for software, it is best to make a custom View with inheritance from the same ImageView in order to implement the necessary actions, because if you get to the standard from the outside, there will be problems with positioning (it will move down-right, not from the center). Sample custom view - pavlofff
  • Thank you for the answer. I have each icon (ImageButton) has a different background (background), how can I make one for all selectors which will enlarge and add a frame? If you set the background in the src parameter: the picture looks wrong. Tell me please! - Oleg Pylypiv

0