How can I measure / get the width of the title and logo of Android's ActionBar? I need this to properly align elements in my activity so they don't look odd.
Thanks!
Related
Currently, each bar's domain label appears below the left hand side of each bar, as pictured here:
Is there a way to position labels below each bar's center ?
This should do the trick:
XYGraphWidget.LineLabelStyle style = plot.getGraph().getLineLabelStyle(XYGraphWidget.Edge.BOTTOM);
style.getPaint().setTextAlign(Paint.Align.CENTER);
I believe you are doing that on canvas.
You already know the width of the bar.
Measure the text size (width) to be displayed using
Measuring text height to be drawn on Canvas ( Android )
(barWidth/2 - textWidth/2) + barLeft should do, i think.
Seems like something that should be easy to find, but it's harder than I thought.
What is the default height on the TabLayout in DIPs?
Material Design guidelines state that this height equals 48dp when You have text or image, and 72dp when You have image and text.
its height is "?attr/tabIndicatorHeight"
E.g.
you can use this value in an xml file for another view like:
android:layout_marginBottom="?attr/tabIndicatorHeight"
And it will look ok on all devices.
I want to create an image in photoshope for actionbar image background, so I have to create new image but I just don't know how to specify its height and width, so that it will be fit in actionbar
any suggestion please
The ActionBar's width vary from every devices, the suggested height of the actionbar is 56dp according to Google Design.
For more detail: http://www.google.com/design/spec/layout/metrics-keylines.html#metrics-keylines-keylines-spacing
Wish it could help.
I am having problem with custom seek bar I am not getting same as i expect, I am using 2nd image as progress drawable and first as thumb, but when i use wrap content it is small and when i use fill parent it is repeating and the seek bar different from the 2nd image in the UI?
You should use Nine-path graphics. With this android will automatically resize your image based on borders you provide in graphics.
set maxHeight and minHeight of seekbar properties.
example:
maxHeight = 40dp
minHeight = 40dp
Is it possible to set height and width of tabs in Android? I tried setting customized textview as the indicator of tabspec, setting its height and width to different values, but no matter what its height and width value is, it's always set to the default height and width value.
Yes, but it is quite a bit of a hassle. The layout for the tab widgets uses a fixed height, so you'd have to change that layout directly. One way of doing that is to extend TabWidget, override the addView method and change the widgets according to your needs.