I'm having sizing issues with my action bar buttons on Android 4.2.2. On all other versions, the sizes are acceptable (thought it's still maddening that I can't get one standard size). Android 4.2 appears to be constraining the widths of the buttons (which are rectangular and not squares) down to fit within the width of whatever 4.2 feels that the action bar buttons ought to be. Is there a way to instruct the program how wide action bar buttons ought to be, or how wide my specific buttons ought to be?
I've created a test project that has my action bar background and one of my buttons, in order to try to track down the problem. Here is how it appears in the emulator for the problematic 4.2:
http://i1364.photobucket.com/albums/r728/jasonjtyler/ScreenShot2013-06-27at110115AM_zps9b1bd09a.png?t=1372349904
Here it is in 4.0, which is basically representative of the other versions also (besides 4.2):
http://i1364.photobucket.com/albums/r728/jasonjtyler/ScreenShot2013-06-27at110951AM_zpsa5734a91.png?t=1372349914
Thanks for any help.
Jason
Um... What I see in a picture in not in line with design guides and doesn't look good.
My guess is that you are trying to do something the way you shouldn't do it.
Make your button standrard sizes and in a shape of a square not a rectangle.
For cancel option there exists standard image of a cross.
I think you should use this image, but customised it to your desing.
Action bar icon size in Android 4.2
Related
I have this ratingbar which is inside the applications and it is always displaying correctly.
But recently I realise that it is not working correctly on some devices (which include Nexus 5 with Lollipop version). The rating bar are covered by a black overlay as shown on the image below (only on some devices). When listview (with rating stars) is scrolled, the rating bar will be shown (and then black overlay shows again). it only affect the yellow stars but not the white ones.
I am not sure if anyone had ever met this problem before? I am thinking if it is the recent android update on Nexus 5 that causes this as the rating bar works well on other devices.
Accoring to me,
This may be using v21 of the support libraries or possibly unstable OS update as .xml file and code is not available.
These are the issue reported on google for rating bar please check link below,
RatingBar rendering broken on devices
The development team has fixed the issue that you have reported and it
will be available in a future build.
RatingBar w/ Custom Stars Drawable is rendered as 1 stretched star on pre-Lollipop phones
when using v21 of the support libraries, the RatingBar w/ custom stars
renders as expected. With v22, instead of 5 stars, you just get one,
but stretched to match the width that 5 stars should take
First of all, do not use RatingBar#setProgressDrawable because no
matter what platform, it is going to work like #setBackground()
(single stretched image for whole background). Secondly, setting
android:ratingBarStyle on theme level does not work. I ended up
creating custom style, with "android:progressDrawable" and applying it
for every view I needed.
RatingBar does not render in InfoWindow
setting the style to android:attr/ratingBarStyle does not work, and
ratingBarStyleSmall does work
I would like an ActionBar where I place an image/logo in the center of the bar, rather than the default left end. I'm using the standard android classes building with level 18, no compatibility classes and no ABS. I've looked at this solution which seems to be the most popular answer:
ActionBar logo centered and Action items on sides
... but it simply doesn't work for me. I'm using various devices including HTC One with 4.2.2, Nexus 7 with 4.2.1. However much I play with the solution, the text or image still appears left aligned, plus the layout file only takes effect for the width of the image, and does not span the entire ActionBar.
My request is just for the solution to centering the logo, I'm not interested in any left or right home/menu buttons.
A centered logo on the ActionBar actually violates the Android Application Design Guidelines unfortunately, you can find a comprehensive guide here:
http://developer.android.com/design/get-started/ui-overview.html
The accepted norm is to have the logo to the left hand side.
I have an app that utilizes Action Bar Sherlock and has 5 icons at the bottom(split when narrow). On most devices, the 5 icons are visible but on Motorola RazR or in emulator with long screen ratio and xhdpi(540x960), only 4 icons are visible and I guess that's what they call an overflow.
What I can't understand is that even if I set the icons to very small images, enough for 5 to fit on the screen, the RazR only shows 4 with wide spaces in between.
Is there a limit that can be changed so that I can forceably display all 5 icons on the bottom? Thanks!
(I don't want to post long unrelated junk of codes here so just tell me what part do you want to see)
After some more research, looks like It is impossible to change. On this document link
The number of icons is dependent to its screen density.
Looks like the best solution is to have your custom made bottom menu bar.
I'm developing a simple app with a customized background and a button in the middle.
I've got the whole different resolutions for different screens down, but do all the versions of the background need to be 9patches? How do I take into consideration the always there android top navigation bar and the possible use of advertisements at the bottom? Do they just cover the design or do they change the resolution?
I've got the whole different resolutions for different screens down
that's not how it works on android. see this:
http://developer.android.com/guide/practices/screens_support.html
do all the versions of the background need to be 9patches?
no . you decide . normally, buttons and views use the 9 patch images, but it can be useful for many other things. more info:
http://android10.org/index.php/articlesother/279-draw-9-patch-tutorial
http://radleymarx.com/blog/simple-guide-to-9-patch/
How do I take into consideration the always there android top
navigation bar and the possible use of advertisements at the bottom?
you can put a linear layout which has the ad on the bottom , and once it will be shown , the upper view will shrink its size.
about the action bar on the top, it doesn't matter , since the layout is below it anyway.
if you wish, you can also hide the top bar. however , if you have the bottom navigation bar (as on honeycomb and some ice-cream sandwich devices ) , you can't just hide it , since the end user must be able to press the back and home buttons .
Do they just cover the design or do they change the resolution?
you (and also those components) can't change resolution just like on a PC . everything takes space depending on your code and layout.
it seems that you need some guidelines of how to design for android. may i suggest checking out those links:
http://developer.android.com/design/index.html
http://www.google.com/events/io/2011/sessions/designing-and-implementing-android-uis-for-phones-and-tablets.html
http://www.google.com/events/io/2011/sessions/honeycomb-highlights.html
Is anyone else having this problem? http://android-ui-utils.googlecode.com/hg/asset-studio/dist/index.html When i try to use an image and i upload the image it just turns out to be a grey box. I have tried in all different browsers and still no luck.
You probably have one of two issues.
1) To verify if the image is getting processed, make sure you select 'Launcher Icons' from the main screen as a test. Other icons are not full color, they are Grey or black or white. For Example, the icons for the Action Bar are supposed to be Grey (depending on theme). See the action bar design guidelines. If you see your icon, but it is square instead of it's native 'shape' you have the second issue.
2) Use gif (or png) as your original and make sure you set the transparent color when you created it.
The tool works well for me in several browsers. I suggest you try a different browser, and make sure your bitmap isn't corrupt.