开发者

android shrink a background to the layouts size

I want to shrink the background of a layout component to fit the actual contents. The background's will strech automatically but will not shrink.

<LinearLayout android:layout_height="wrap_content"
                android:orientation="vertical" android:layout_width="fill_parent"
                android:开发者_StackOverflowgravity="top" android:background="@drawable/background"
                android:paddingRight="10dp" android:paddingLeft="10dp" android:paddingTop="10dp">


Create the background image as a 9-patch image, save it as the smallest dimensions you want to support, and Android will take care of the rest. You can read up about it here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜