Zal*_*inh 10 android image imageview
我想要显示图像的某些部分.就像一本漫画书.我有一个像这样的图像.
当我点击图像时,某些部分显示如下.

我想显示这种类型.在这个过程中,我创建了一些包含主图像图像部分的zip文件.我完成了显示每个图像序列.但我的问题是如何获得实际图像的任何部分点击并在第二个屏幕显示这个?
我无法获得图像部分ID.那么如何获得这部分图像ID.
所以请帮帮我.我卡住了.
你可以用一个技巧来解决这个问题。
在布局内设置按钮(背景为透明)。
设置按钮的 OnclickListener 以显示您想要在课堂活动中显示的弹出窗口。
您还可以根据您的要求按可见/不可见功能管理按钮单击事件。
已编辑
您的 xml 将如下所示。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/YOUR_IMAGE" >
<Button
android:id="@+id/btn_invisible"
android:layout_width="85dp"
android:layout_height="30dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="18dp"
android:background="@android:color/transparent" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
以及 Activity 类的 OnCreate() 方法内部。
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
setContentView(R.layout.help_1);
btn_invisible = (Button) findViewById(R.id.btn_invisible);
btn_invisible.setOnClickListener(this);
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if (v == btn_invisible) {
//Whatever Code you want to Use for Show Popups
}
Run Code Online (Sandbox Code Playgroud)
我不确定,但你可以尝试一次。
| 归档时间: |
|
| 查看次数: |
736 次 |
| 最近记录: |