ios - Add Bubble view dynamically -


enter image description here

hi guys, have achieve above design. here no of bubbles dynamic (maximum 8) , size of each bubble dynamic. have designed bubbles dynamically can't find out way add bubbles (i mean in position, bubble) output looks above.

bubble formed randomly each , every times 2 bubbles

enter image description here

for 4 bubbles

enter image description here

but there no particular logic time 2 , 4 bubbles position same.

to honest far away start cause couldn't figure out logic. idea, appreciable. thank you.

do:

  • create class method set frames
  • prepare layout how display. depend on no of bubbles.

    for ex:

  • if 1 bubble show in center screen

  • if 2 bubbles show both in 1 line

  • if 3 bubbles make round display

  • if 4 bubble square display

  • if 5 bubbles shape shown image here above

so define frames buttons checking no of bubbles. after you'll need use class code. automatically take frames defined in class.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -