2011-08-30 123 views
0

我想要在屏幕中间显示一张图片,指导人们按下哪些按钮(例如,箭头按钮)。我使用什么方式使箭头设计出现在适当的位置,并在我做某件事后消失(如按屏幕)如何在活动上添加图形叠加层? Android

谢谢!

编辑 这里是我的活动之一的XML布局,注意底部的ImageView的,它显示在前面的图片

<?xml version="1.0" encoding="utf-8"?> 

<RelativeLayout android:layout_width="fill_parent" 
    android:layout_height="45dp" android:background="@drawable/mytitlebackground" android:id="@+id/relativeLayout1"> 
    <ImageButton android:id="@+id/btnAddFriends" 
     android:layout_width="wrap_content" android:src="@android:drawable/ic_input_add" 
     android:layout_height="wrap_content" android:layout_alignParentTop="true" 
     android:layout_alignParentRight="true"></ImageButton> 
    <TextView android:id="@+id/textView1" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/imTracking" android:textAppearance="?android:attr/textAppearanceLarge" android:layout_centerVertical="true" android:layout_centerHorizontal="true"></TextView> 
</RelativeLayout> 

<Button android:id="@+id/btnUpdateLocation" android:text="Update Location" 
    android:layout_width="wrap_content" android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:layout_centerHorizontal="true"></Button> 
<ImageButton android:src="@drawable/mapbutton" 
    android:layout_width="wrap_content" android:id="@+id/btnMaps" 
    android:layout_height="wrap_content" android:layout_alignParentBottom="true" 
    android:layout_alignParentRight="true" android:layout_alignTop="@+id/btnUpdateLocation"></ImageButton> 
<ImageButton android:text="Refresh" 
    android:src="@android:drawable/stat_notify_sync" android:layout_width="wrap_content" 
    android:id="@+id/btnRefresh" android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:layout_alignParentLeft="true"></ImageButton> 
<LinearLayout android:layout_width="wrap_content" 
    android:layout_height="wrap_content" android:layout_below="@+id/relativeLayout1" 
    android:layout_alignParentLeft="true" android:layout_above="@+id/btnUpdateLocation" android:id="@+id/linearLayout1"> 
    <ListView android:id="@+id/imtrackinglistview" 
     android:layout_height="wrap_content" android:layout_width="fill_parent" 
     android:layout_weight="1"></ListView> 
</LinearLayout> 
<ImageView android:id="@+id/iVImtrackingpopup" android:layout_width="300dp" android:layout_height="330dp" android:src="@drawable/imtrackinghelp_en" android:layout_centerVertical="true" android:layout_centerHorizontal="true"></ImageView> 

当我尝试“点击”相关布局以使图像不可见,除非单击布局的顶部,否则它不起作用

RelativeLayout Imtrackingrelativelayout=(RelativeLayout) findViewById(R.id.relativeLayoutImtracking); 
    Imtrackingrelativelayout.setOnClickListener(new OnClickListener() { 

     @Override 
     public void onClick(View v) { 
      ImageView imtrackingoverlay=(ImageView) findViewById(R.id.iVImtrackingpopup); 
      imtrackingoverlay.setVisibility(View.INVISIBLE); 

     } 
    }); 

回答

1

使图像居中对齐,并把在单击根布局和点击监听,使这一形象无形......最好使用此相对布局.....

+0

好主意!我明天早上会试试这个! –

+0

所以我试图把这个在列表视图,但图像显示在它后面,我如何确定图像的顺序 –

+0

显示我们的代码.... –

相关问题