I am using the onCreateOptionsMenu method to create a toolbar with icons in the MainActivity of my app. I am testing on different screen sizes and pixel densities with Android Studio's emulator. The documentation states,
"Based on the density of the current screen, the system uses any density-specific resources from your app. If resources are not available in the correct density, the system loads the default resources and scales them up or down as needed."
I've tried putting all of my vector icons the default drawable directory, but the system does not scale them for different screen sizes or densities at all. Nor does onCreateOptionsMenu scale the height of the toolbar or the title text. Is it supposed to?
Because of this, I have also tried using different density buckets to address that problem. However, I'm running into an issue with greatly varying screen sizes sharing the same density bucket.
As an example, I'm testing on Pixel 3 (5.5" phone) and Pixel C (10" tablet). They are using the same density bucket (xhdpi) so if I use a 24dp x 24dp icon for the phone, then it looks way too small on the tablet. How do I work around this?
Android menu icons scaling issue
275 Views Asked by gig6 At
1
There are 1 best solutions below
Related Questions in ANDROID
- Creating global Class holder
- Flutter + Dart: Editing name of a tab shows up a black screen
- android-pdf-viewer Received status code 401 from server: Unauthorized
- Sdk 34 WRITE_EXTERNAL_STORAGE not working
- ussd reader in Recket Native module
- Incorrect display of LinearGradientBrush in IOS
- The Binary Version Of its metadata is 1.8.0, expected Version is 1.6.0 build error
- I can't make TextInput to auto expand properly in Android
- Creating multiple instances of a class with different initializing values in Flutter
- How to create a lottie animation
- making android analyze with coverity sast tool
- Flutter plugin development android src not opening after opening example
- I initialize my ViewModel in the Activity with several fragments as tabs, but the fragments(tabs) return null for the updated livedata
- Node.js Server + Socket.IO + Android Mobile Applicatoin XHR Polling Error...?
- How I can use the shared preferences class?
Related Questions in SCALE
- I need an azure product that executes my intensive ffmpeg command then dies, and i only get charged for the delta. Any Tips?
- Merge Azure mp4 blobs via API (Preferred Azure)
- Colorbar and contour plot seem to not match data; individual/custom scale to emphasize data of interest
- Weight measurement with real-time time stamping using the Kern KB 3600-2N precision balance
- Highcharts Spider Chart with different scale for each category
- GKE cluster shutdown
- Prevent blocking the event loop on sync operations
- How to keep original x-axis after utilizing a custom scaling for the geom_rect in ggplot?
- ESP32 attachInterrupt causing (Interrupt wdt timeout on CPU1)
- How to fix SVG being cut off when using as background?
- How to move the background image by clicking and dragging the mouse smoothly?
- How to use pyplot to show data with no scale on xaxis and allow to pan (shift) via mouse
- Page scales down on mobile when width is below 980px
- signalr - programatically scaling up (from azure function)
- Getting scale offset inside tkinter canvas
Related Questions in SCREEN-SIZE
- Get Screen Display Size (Diagonal) in Inches
- Unexpected Screen Resolution Change in Windows Server during Automated UI Testing via RDP: How to Fix?
- Jetpack compose UI support for different screen sizes and Image crop from the top
- How to set text size according to the screen size in Jetpack Compose?
- Can a websites render differently in a maximized browser window v.s. a custom size window of the same size
- Filtering in Statamic using Livewire
- Maui On Screen size Markup Plugin how to adjust Margin Element within Style File
- Setting QT_AUTO_SCREEN_SCALE_FACTOR cause QTableWidget gridline and headerView border line miss-alligned
- PowerApps - screen size issues
- PowerApps responsive layouts
- Excel Page size changing between screen sizes
- Could to Get Size Screen When Orientation Changed With Static Method on Java Android?
- iphone 11 and iphone 12 are showing different results for same layout
- problem with adapting function depending on screen width size
- Different Mobile Screen Resolution
Related Questions in ANDROID-VECTORDRAWABLE
- Jetpack Compose displaying Adaptive Icon Painter Resources: Only VectorDrawables and rasterized asset types are supported ex. PNG, JPG, WEBP
- How to use MaterialTheme.colorScheme.primary inside a vector?
- Cut out part of a vector drawable path
- How to make the canvas not square?
- what tint value for vector asset should be set?
- How to fill color in the inside transparent portion of vector drawable without filling color in the outside rectangualar bounds of it?
- how to create a vector drawable for a document in a circle in Android
- Jetpack Compose App crashed when updated from previous version
- Issue with Gradient Drawable on Android 6 Marshmallow while using Splash Screen API
- Is there a way to organize my drawables in android studio?
- How to make EditText and Button have this colored border?
- Android complicated schematic view
- Vector drawable scaling in ImageView on Android
- Android Studio Vector Asset: Error while parsing ****.svg- Not a proper SVG file
- How to change color of drawable ImageView android kotlin
Related Questions in PIXEL-DENSITY
- How can I change pixelDensity midway through running the sketch?
- How to tell pdf generation tool to make PDF of specific pixel width across devices (i.e. make PDF to display in browser using pixel dimensions)?
- Why displayMetrics.density is wrong?
- Reducing the pixels-per-inch (PPI) of an image results in same file size
- What is the recommended way to convert between pixels and points in SwiftUI?
- Conversion of Figma designs to React Native
- how can i solve the issue of right overflowed by 382 pixels
- responsive images with srcset, sizes, media-queries - Prevent loading huge images for higher pixel density
- Density group for tablet of size 10.5" and 11"
- CodenameOne - Using 1x 2x 3x images of XCode Assets.Casset catalog in CN1 project
- Android menu icons scaling issue
- What is the smallest possible screen size that will use sw-600dp layout?
- Not getting exact value from float calculations in a java code
- Android: PDF created using PrintedPdfDocument looks different on different devices
- How to display 10cm on web browser no matter the scaling?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can string together multiple qualifiers and create a custom bucket. So in addition to the drawable-xhdpi bucket I added a drawable-sw720dp-xhdpi bucket with larger icons for the 10" tablet. Now tablet displays the slightly larger icons while the phone still uses the standard bucket. The solution can be found in the comments of the selected answer in this post by @Theo. Unfortunately the documentation does not state that multiple qualifiers are supported.