用于说明的小弹出窗口,例如四方的 [英] Small Popup for Instructions, like foursquare ones

查看:23
本文介绍了用于说明的小弹出窗口,例如四方的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在看到新的foursquare 应用程序的最后一个屏幕截图和他们的气球状卡通说明后,我想在我的应用程序中创建其中的一些.

After seeing the last screenshots of new foursquare application and their balloon like cartoon instructions, I'd like to create some of these in my application.

我发现了一个关于 iPhone 的类似问题用于说明的小弹出窗口...如何?

I found a similar question for iPhone Small popup for instructions... How?

这是foursquare应用程序的另一个截图:

Here is another screenshot of foursquare app:

我想知道如何使用 Android 实现这一目标.

I'd like to know how I could achieve that with Android.

提前感谢您的帮助.

更新:这是我目前所能做到的,但添加了一些带有自定义绘制背景的按钮并使用 FrameLayout 将它们分层:

UPDATE: This is what I could get so far but adding some buttons with a custom drawn background and layering them with a FrameLayout:

但我仍然无法获得三角形效果.也许我可以用我的自定义背景形状做些什么?

But I still couldn't get the triangle effect. Maybe there is something I can do with my custom background shape?

更新2

在查看了您的建议后,我决定采用 Aaron C 的想法,并添加了一张带有箭头的图片.这是我目前的结果:

After checking your suggestions, I decided to go with Aaron C idea and added an image with an arrow on it. This is my current result:

谢谢 Snailer,QuickAction API 项目看起来很有前途.在我的应用中实现更多功能时,我会检查一下.

Thank you Snailer, QuickAction API project seems very much promissing. I'll check it out when implementing more features in my app.

现在,我只需要获得正确的颜色,或者我可以让它这样.看起来也不错.

Now, I just need to get the right color or maybe I could just let it this way. It seems nice too.

所以,总结一下我所做的:

And, so, to summarize what I did:

  1. 在 FrameView 中获得了我的初始 xml 布局.
  2. 因为我使用的是框架视图,所以我放在这里的所有东西都会一个接一个地堆积起来.这就是我可以在布局中添加内容的方式.

  1. Got my initial xml layout inside a FrameView.
  2. As I'm using a frameview, everything I put in here will be piled one over the other. That's how I could add things to the layout.

在那个框架布局中,我放置了 2 个相对布局,其中包含一个带有三角形的图像和一个按钮来创建两个上部弹出窗口.在底部我只放了一个按钮.

In that framelayout, I put 2 relativelayouts whith an image with the triangle and a button to create the two upper popups. In the bottom I put a button only.

就是这样.我希望它可以帮助某人.

That's it. I hope it helps somebody.

再次非常感谢您的帮助!

Thank you very much again for all your help!

推荐答案

这听起来是个不错的实现.AlertDialog 上可能有一个内置的 Android 变体可以实现这一点,但如果没有,我将如何实现它:

That sounds like a neat thing to implement. There might be a built-in Android variation on AlertDialog that achieves this, but if not here is how I would go about implementing it:

创建一个新的 Activity,其背景为黑色,具有非常高(低?)的 alpha 颜色值.这将允许您通过它查看堆栈中的前一个 Activity.然后,使用具有填充值的相对布局在您喜欢的任何坐标处添加警报.

Create a new Activity whose background is black with a very high (low?) alpha color value. This will allow you to see through it to the previous Activity in the stack. Then, add your alert at whatever coordinates you like using a relative layout with padding values.

您可能还想添加一个触摸侦听器,如果用户触摸气球(或者可能在屏幕上的任何位置),它会退出 Activity.

You might also want to add a touch listener that exits the Activity if the user touches the balloon (or maybe anywhere in the screen).

如果您想了解气球的坐标位置,可以使用带有 putExtra() 方法的 Activity 的启动 Intent 将此信息传递到新的 Activity.

If you want to be fancy with coordinate placement of the balloon, you can pass this information into the new Activity using the Activity's launch Intent with the putExtra() methods.

这篇关于用于说明的小弹出窗口,例如四方的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆