I have the following situation: I want to draw an rectangle on a canvas and inside the rectangle a text of a certain size. How can I make the rectangle have 1/4 width of the screen on all screen sizes, and how can I know what setTextSize to give to the inside text in order to not exceed the rectangle boundaries ? I have read http://developer.android.com/guide/practices/screens_support.html but I'm not fully clear with the concepts.
Draw on canvas on different screen resolutions and densities
2.1k views Asked by Alex At
0
There are 0 answers
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 DRAW
- Draw polygon next to an another one
- Performance slowdown and inaccuracies in stroke rendering due to float-based distance calculation in drawing
- With the canvas, draw and fill a rectangle with a rectangular hole in it
- In julia gamezero i want to programatically change the tint of a draw object. However, colorant doesnt allow variables to be substituted into strings
- Need Help How To Draw Both Arabic And English Words Char By Char
- matplotlib plot not updating after the plot is first shown with .show
- How do I draw this plot in Maple?
- Having some issues with Void Draw in Processing
- How would I redraw the lives count in my game
- How to draw just one connected component in python using networkx
- Trouble Creating Dynamic Polygons with JavaScript and CSS
- Issue with Sequential Touch Points in Using CALayer for Drawing in Swift
- How to optimize rendering performance when drawing a large number of animated shapes on a JavaFX canvas
- How to run code.org animations offline using javascript and html files?
- How download in png a svg made with Mxgraph
Related Questions in ANDROID-CANVAS
- BlendMode does not work as expected with a path and circle in Jetpack Compose
- How to draw image in canvas compose without stretching the image
- How to skew the x axis labels in canvas in Kotlin
- Create a VideoFrame from Canvas
- How to center an image on canvas after rotate the image (Konva.js)
- Android Canvas onDraw and Resize When ViewGroup was changed size ( synchronize )
- Image to Bitmap conversion with MLKit returns null
- Canvas.drawBitmap() fails on Android 9 device
- How to match Android Canvas to A3 paper size?
- Canvas Drawing conversion to DWG/DXF
- How to pick the Color code from a position in Android Linear Gradient?
- Android: How to scroll a closed path
- Jetpack Compose - best way to handle pixel-exact composables with pointer input
- How to overlap two path figures on Canvas?
- When the update occurs on Android TV, canvas seems to expand
Related Questions in SCREENS
- React Native: Test app in different resolutions
- Center C# form on secondary screen
- LibGDX NullPointerException when switching screens
- How to make scaled 0-1 layout Android Studio
- How to access the value from another class/screen kivy
- Kivy widget in python to kv file, how control it
- Android dimens file for multiple screens
- My Android Studio keeps ignoring Large Layout and picks Normal for ALL screens
- change between menu or pause screens on libgdx
- Java awt GraphicsDevice TYPE_PRINTER?
- Java - Libgdx : Save & Load a screen
- Android XML resize / fit ImageButton different screens
- Java - dual screens strange behavior
- Sage CRM - See the name of the screens used in a tab?
- Are VCL ListViews ListBox DBGrids full touch aware?
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?
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)