A
A
a252011-08-26 11:32:54
iOS
a25, 2011-08-26 11:32:54

Iphone programming. Changing the appearance of components?

There is a need to change the appearance of standard components (buttons, tabs, table rows, etc.) in accordance with the design. The functionality, accordingly, should remain the same as it is. Among the most typical changes are buttons of arbitrary shapes (round, with shadows), the appearance of tabs (for example, this one: id843992.html). What is the general approach in such situations? There are a couple of ways, I would like to assess their viability and complexity.
1. Inheritance of standard classes and redefinition of some drawing methods. The problem is that I didn’t find such methods (it’s unlikely that apple will open them to the outside if it doesn’t want the components to be customized).
UPD. Clarification of the question.The drawRect method is not covered here. I meant methods like specifying the background of tabs, changing the location of the tabs themselves (for example, moving them from bottom to top), changing the color of the tab and others that would allow changing its appearance without custom drawing.
2. Creating components by hand from the UIView by drawing the appearance or a combination of drawing and design pictures. Here the problem is that you will also have to program a lot of functionality (including animation).
UPD.3. Using the drawRect method. As far as I've seen from components created by others, this is the only way. Accordingly, the downside is that it is not always possible to use a design in the form of pictures (only if you combine it with drawing primitives, curves, etc. operations). Well, the growth of complexity depending on the device of the component.
Maybe there are some component libraries or at least approaches? Maybe there are some open source applications where this is implemented?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
kaapython, 2011-08-26
@kaapython

I would start by looking for components similar to the required ones on cocoacontrols .

D
dals, 2011-08-26
@dals

Some types of customizations (for example, in UISwitch to change the inscriptions from standard to some of their own, change the background) fell under the Private API not so long ago, with the corresponding consequences.
Erica Sadun wrote (and probably writes) interesting things in this regard, with debriefing.
As for the idea ... here 's the same "your" flexible UISwitch.
Read the code, it might help.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question