Android
Intuit :: ๋ค์ํ ์คํฌ๋ฆฐ ์ฌ์ด์ฆ๋ณ, ์กฐ์ ์ง์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ::dp,sp
๋์บ๋ฆฌ๐ฑ
2022. 6. 9. 09:14
๋ฐ์ํ
๊ธฐ๊ธฐ๋ณ๋ก ํด์๋๊ฐ ์ ๊ฐ๊ฐ์ด์ฌ์,
dimen ์ผ๋ก ํด๊ฒฐ ํ๋ ๋ฐฉ๋ฒ์ด ์์ง๋ง ํด๋น ๋ฐฉ๋ฒ๊ณผ ๋น์ทํ๊ฒ ์ฌ์ฉํ ๋งํ ์ด intuit ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ ์๋ค!
์๋ ๊นํ๋ธ ๊ณต์์ ์ฐธ๊ณ ํ๋ฉด ์ด๋ ต์ง ์๊ฒ ์ธ ์ ์๋ค.
GitHub - intuit/sdp: An Android SDK that provides a new size unit - sdp (scalable dp). This size unit scales with the screen siz
An Android SDK that provides a new size unit - sdp (scalable dp). This size unit scales with the screen size. - GitHub - intuit/sdp: An Android SDK that provides a new size unit - sdp (scalable dp)...
github.com
+ "์๋๋ก์ด๋ ํฌ๊ธฐ ๋จ์" ์ ๋ํด์
ํด์๋ : ํ๋ฉด์ ์๋ ๋ฌผ๋ฆฌ์ ํฝ์
์ด ๊ฐฏ์
dpi (dots per inch)
- inch: ์ค์ ๋ฌผ๋ฆฌ์ ํ๋ฉด ํฌ๊ธฐ (์ธ์น ๊ธฐ์ค)
px: ํ๋ฉด ๋ด์, ์ค์ ํฝ์
์ ๋์ํ๋ ๋จ์
dp:
dp <-> px ์
: px = dp * (dpi/160)
๋ฐ์ํ