0
I made an application where I create part of the interface in xml and part via java code, the xml part works in any application adapting the screen size. The part via code in a 7.8 inch device is good, but in a 4 inch screen is all disfigured (source of the giant views). I’ve researched a lot on the Internet and nothing works. Does anyone know what I can do? Thanks in advance.
I tried to use this code but it didn’t work:
tv2.setTextSize(20 * getResources().getDisplayMetrics().scaledDensity);
This code you posted can cause this problem. If you are always using
tv2.setTextSize(20);
then the problem is elsewhere. Place the code where you create these views.– ramaral
i only use Textview in this application, if I put setTextSize(x) also of the problem.
– daniel12345smith