๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๋นˆ ๊ตฌ๋ฉ ์ฑ„์šฐ๊ธฐ

[Android][Lint] Missing baselineAligned attribute

์‹œ์ž‘

Lint ๊ฒฝ๊ณ  ํ™•์ธ ์ค‘ ํ•ด๋‹น ๊ฒฝ๊ณ ๋ฅผ ํ™•์ธํ–ˆ๋‹ค.

๊ด€๋ จ ์„ค๋ช…์€ ์ด๋Ÿฌํ•˜๋‹ค.

 

Set android:baselineAligned="false" on this element for better performance

๋ฐœ๋ฒˆ์—ญ

์ด ์š”์†Œ์˜ ์„ฑ๋Šฅ ๊ฐœ์„ ์„ ์œ„ํ•ด android:baselineAligned="false" ๋กœ ์„ค์ •ํ•˜์‹œ์˜ค.

 

์‚ดํŽด๋ณด๋‹ˆ ์ด ๊ฒฝ๊ณ ๊ฐ€ ๋œจ๋Š” ๋ถ€๋ถ„๋“ค์€ LinearLayout๋“ค์ด๋‹ค.

 

When a LinearLayout is used to distribute the space proportionally between nested layouts, the baseline alignment property should be turned off to make the layout computation faster.

๋ฐœ๋ฒˆ์—ญ

LinearLayout์ด ๋‘˜๋Ÿฌ์‹ผ ๋ ˆ์ด์•„์›ƒ๋“ค ์‚ฌ์ด์— ๋น„๋ก€์ ์œผ๋กœ ๊ณต๊ฐ„์„ ๋ถ„๋ฆฌํ•˜๋Š”๋ฐ ์‚ฌ์šฉ๋  ๋•Œ, baseline ์กฐ์ •alignment ์„ค์ •property๋Š” ๋ ˆ์ด์•„์›ƒ ๊ณ„์‚ฐ์„ ๋” ๋น ๋ฅด๊ฒŒ ํ•˜๊ธฐ ์œ„ํ•ด์„œ ๊บผ์•ผ ํ•œ๋‹ค.

 

baseline alignment๊ฐ€ ๋ฌด์–ธ์ธ๊ฐ€

 

https://aroundck.tistory.com/2576

 

[android] baselineAligned ์†์„ฑ์˜ ์ •์ฒด.

android, baselineAligned ์†์„ฑ์˜ ์ •์ฒด. LinearLayout ์— ํฌํ•จ๋˜๋Š”, TextView ๋“ค์€ ๊ธ€์”จ๋“ค์˜ first line ์„ align ํ•˜๋„๋ก ๊ธฐ๋ณธ ์„ค์ •์ด ๋˜์–ด ์žˆ๋‹ค. ๊ทธ๋ž˜์„œ ์œ„์™€ ๊ฐ™์ด ํ•œ์ค„์งœ๋ฆฌ text ๋ฅผ ๊ฐ€์ง„ ๋ฒ„ํŠผ๋“ค ์ค‘๊ฐ„์—๋‘์ค„์งœ๋ฆฌ text

aroundck.tistory.com

 

์š” ๊ธ€ ๋ณด๊ณ  ์ดํ•ดํ–ˆ๋‹ค.

 

LinearLayout ์•ˆ์— ์ž๋…€๋“ค์ด Layout๋“ค์ด๋ฉด baseline alignment๋ฅผ ํ•  ํ•„์š”๊ฐ€ ์—†๊ธฐ๋Š” ํ•˜๋‹ค. ์“ธ ํ•„์š”๊ฐ€ ์—†๋Š” ๊ธฐ๋Šฅ์ด๋ผ false๋กœ ๊บผ๋ฒ„๋ฆฌ๋Š” ๊ฒƒ์ด ๋‚ซ๋‹ค๋Š” ๊ฒƒ์„ ์ดํ•ดํ–ˆ๋‹ค.  

 

ํ•ด๊ฒฐ

ํ•ด๋‹น LinearLayout์˜ attribute๋กœ android:baselineAligned="false"๋ฅผ ์ถ”๊ฐ€ํ–ˆ๋‹ค.