Tell statusbar how to find out the height statusbar and tabbar for different screen resolutions. It is necessary to calculate the height of the free space between the status- and tabbar . I can not understand what size to transfer to the designer. Found in sources only in pix-ах , but this value will vary depending on the screen size ...

  • let him do it for 2-3 screens, and then you set it up in dp - Gorets
  • 2
    s / sama / sama / - KoVadim
  • ---- Let her do for 2-3 screens, and then you set it up in dp yourself ----- Let’s say she does for 320/480 without taking into account the height of the tabs, but then the picture itself doesn’t "fit "under" cropped "size, and the part above and below will be covered? - s01nyshko
  • KoVadim, your comment is incomprehensible. - s01nyshko
  • It is necessary that podstolis itself, draw a draw9patch, correctly set the fill factor. In general, it is difficult to understand / explain it now, but as you try a couple of options, you will figure it out - Gorets

1 answer 1

Yes, this is a headache ... As I sometimes envy the apple makers, they have 2-3 sizes for all occasions and I don’t want to write. In Android'er in this sense, life is sweet.

Initially it is assumed that the dimensions are best expressed in dip 'ah (they are dp ), but this does not always work either.

In your particular case - you have one exact size from which to push: the height of the line (which depends on the chosen font and style). Unfortunately, the height of the line can only be found dynamically:


And dynamically change the height of the tab / statusbar along with the play or whatever you have there.

And tell the designer that the height of your tab will be 1.5 of the font size, and then let it design :)

  • Barmaley, that's for sure !!! She made it pretty fast for apple, and the fun began with android (((. It's not very clear where this line is ---- TextView.getLineHeight () ---- do I need to register? I have tabs here ---- -tabSpec = tabHost.newTabSpec ("tag3"); tabSpec.setIndicator ("Map"); tabSpec.setContent (new Intent (this, MapActivity.class)); tabHost.addTab (tabSpec); ----? Tell, please read more. - s01nyshko
  • TextView.getLineHeight() during onCreate() will be unknown - so see for yourself where to shove it - Barmaley
  • 2-3 sizes? iphone to 4c - 1, ipad - 2, iphone 5 - 3, retina - 5, ipad mini - 6 for a little bit and they have a headache added - Gorets
  • How else can you name tabs, if not in Tabhost? It turns out at the announcement in this method only the name is written and even TextView and does not smell. And in order to register TextView.getLineHeight (), you must first declare TextView and apply, moreover, directly to the name of the tabs. So how to implement it correctly? - s01nyshko
  • TextView can be pulled out of the tab by the method findById () - Gorets