안드로이드 해상도 대응! - ScalableLayout
Android 2015. 1. 15. 13:43http://www.androidpub.com/index.php?mid=android_dev_info&document_srl=2573998
https://github.com/ssomai/ScalableLayout
쩐당.
# 새로운 ScalableLayout 생성할 경우 들어갈 ImageView만큼 width, height를 포함하여 생성하자. 꼭!!!!!!!!!!
// Initiate ScalableLayout instance with 400 width and 200 height.
// It's a relative unit, not pixels or dip.
ScalableLayout sl = new ScalableLayout(this, 400, 200);
res/values/attr.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <?xml version="1.0" encoding="UTF-8"?> <resources> <declare-styleable name="ScalableLayout"> <attr name="scale_base_width" format="float" /> <attr name="scale_base_height" format="float" /> <attr name="scale_textsize" format="float" /> <attr name="scale_top" format="float" /> <attr name="scale_left" format="float" /> <attr name="scale_width" format="float" /> <attr name="scale_height" format="float" /> <attr name="textview_wrapcontent_direction" format="string" /> <attr name="textview_wrapcontent_resizesurrounded" format="boolean" /> <attr name="textview_wrapcontent_movesiblings" format="boolean" /> </declare-styleable> </resources> | cs |