How do dp, dip, dpi, ppi, pixels and inches relate?
问题 I was reading dp, dip, px, sp measurements, but I still have some questions about dp/dpi vs ppi vs px vs inch. I am not able to compare them... is an inch the largest? They say 160 dpi means 160 pixels per one inch. Does that mean 1 inch contains 160 pixels? They also say 1 pixel on a 160 dpi screen = 1 dp. Does that mean 1 pixel and 1 dp are equal? And lastly, why should we use dp instead of px? I understand that it is ideal, but why ? 回答1: You should (almost) always use flexible sizing