安卓學習-介面-使用點9圖製作可拉升圖片

來源:互聯網
上載者:User

標籤:android   style   blog   http   color   使用   strong   ar   2014   

 網上找的圖片

左邊的點代表垂直展開的地區,上邊的點代表水平展開的地區。

右邊的點代表文字等的垂直可可顯示地區,下邊的點代表文字等的水平可顯示地區。

左上重合的地區就是展開地區,右下重合的地區就是顯示地區。

 可顯示地區其實指的是控制項的text屬性設定後文字顯示的地區,以前老是以為是圖片上文字顯示的位置,下面有帶文字的例子

 

經過處理的3張圖

圖1

圖2 

圖3 

 

效果

XML

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="fill_parent"    android:layout_height="fill_parent" >    <Button        android:id="@+id/Button01"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:layout_alignParentLeft="true"        android:layout_alignParentTop="true"        android:background="@drawable/a11"        android:layout_margin="2dp"         />    <Button        android:id="@+id/button1"        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:layout_alignParentLeft="true"        android:layout_below="@+id/Button01"        android:background="@drawable/a11"          android:layout_margin="2dp"/>    <Button        android:id="@+id/button2"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:layout_alignParentLeft="true"        android:layout_below="@+id/button1"        android:background="@drawable/a22" android:layout_margin="2dp"/>    <Button        android:id="@+id/Button02"        android:layout_width="wrap_content"        android:layout_height="match_parent"        android:layout_alignParentLeft="true"        android:layout_below="@+id/button2"        android:background="@drawable/a22"         android:layout_margin="2dp" />    <Button        android:id="@+id/button3"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:layout_alignTop="@+id/button2"        android:layout_toRightOf="@+id/button2"        android:background="@drawable/a33"          android:layout_margin="2dp"/>    <Button        android:id="@+id/Button03"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:layout_alignLeft="@+id/button3"        android:layout_alignParentBottom="true"        android:layout_alignParentRight="true"        android:layout_below="@+id/button3"        android:background="@drawable/a33"          android:layout_margin="2dp"/></RelativeLayout>

 

帶文字地區例子

未完待續。。。。。。

安卓學習-介面-使用點9圖製作可拉升圖片

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.