2012-09-13 27 views
0

這是一個由photoshop實現的原型UI,您可以看到視圖左上方有一個close圖標。視圖左上方的關閉圖標

enter image description here

我不知道是否有在Android的任何控制可以實現這一點?如果沒有,如何做到這一點?

+1

你檢查這http://stackoverflow.com/questions/8982678/how-to-have-activity-in-android-with-a-close - 按鈕,在最頂級的角落 – Android

回答

3

不,你沒有。要獲得這種類型的用戶界面,您只需要分別剪切所有圖像並使用Adapter並膨脹您的自定義佈局。

在你的情況下,你需要創建一個關閉圖標圖像,把它放在一個ImageView中,並將其對齊到任何你想要的位置。

0

希望這將有助於

<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_centerInParent="true" 
    android:background="#00000000" > 


<RelativeLayout 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentTop="true" 
    android:layout_margin="20dp" > 

    <ImageView 
     android:id="@+id/imageView1" 
     android:layout_width="fill_parent" 
     android:layout_margin="1dp" 
     android:background="@drawable/show_alert_round" 
     android:layout_height="wrap_content" 
     android:src="@drawable/ic_launcher" /> 

</RelativeLayout> 

<Button 
    android:id="@+id/button1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentRight="true" 
    android:layout_alignParentTop="true" 
    android:background="@drawable/cross_button" />