Home > Mobile >  Android studio operation problem
Android studio operation problem

Time:09-16

My code no logic errors, but no corresponding results, this is where the wrong

CodePudding user response:

GetTextSize return value is a pixel (px) as the unit, and setTextSize is () a sp, the set can be specified unit:
SetTextSize (int unit, int size)
TypedValue.COM PLEX_UNIT_PX: Pixels
TypedValue.COM PLEX_UNIT_SP: three Pixels
TypedValue.COM PLEX_UNIT_DIP: Device Independent Pixels

CodePudding user response:

reference 1st floor qq_42069597 response:
getTextSize return value is a pixel (px) as the unit, and setTextSize is () a sp, the set can be specified unit:
SetTextSize (int unit, int size)
TypedValue.COM PLEX_UNIT_PX: Pixels
TypedValue.COM PLEX_UNIT_SP: three Pixels
TypedValue.COM PLEX_UNIT_DIP: Device Independent Pixels

Just find this mistake, for it seems that I have wrong

CodePudding user response:

  • Related