2012-09-13 28 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" />