2

When I modify accessibility settings zoom and font size in Android my app layout is all broken.

I'can't find information about good practice to avoid this.

Most of my screen are not lists and are not scrollable, I have a bottom area with button, and in the middle I have complete layout with text fields / buttons / input / ...

  • Font size is too big so the text gets clipped vertically and horizontally.
  • Buttons don't fit in the width and display one over the other.
  • Do I have to manage this with different layouts depending on screen size?
  • Is there a way to automatically truncate text with "..."?
  • Is there a way to prevent some part of my layout to zoom (ex navigation part / lower button area)?
  • How do I prevent view from displaying one over the other (I use contraint layout)?
Phantômaxx
  • 36,442
  • 21
  • 78
  • 108
Nathalie
  • 445
  • 3
  • 14

1 Answers1

0

If I had to take a guess though, you probably are using a constraint or relative layout and haven't made the appropriate adjustments for all the child objects.

For truncating, try looking here - Android: TextView automatically truncate and replace last 3 char of String

For font sizes, it's recommended to use "sp" for the unit type, e.g. "15sp".

For constraint layouts, you need to set the anchors for each child object or they end up bunching up in the middle together.

this is a tutorial on constraint layouts - https://codelabs.developers.google.com/codelabs/constraint-layout/index.html?index=..%2F..%2Fio2018#0

zuko
  • 527
  • 4
  • 9
  • Thanks. First I made the central area scrollable wich is OK for most screens.But in the end I forced a density / font to reset do default value when app is starting. – Nathalie Jul 16 '18 at 09:23