开发者

Sliding in a layout for user input

I have a ListView and each item contains a TextView displaying a number. I'd like to give my users the ability to change this number while staying on the ListView (as opposed to drilling down into a detailed view by clicking on the list item).

What I'm looking to do is to slid开发者_如何转开发e in a layout from the bottom of the screen that covers about half of the screen. I'd like this layout to be OVER the Activity behind it (as opposed to being part of that Activity's layout and simply showing it). I'd also like it to be model (or seem modal). Meaning the Activity behind it can not be focused and manipulated. In this layout I will essentially create a calculator.

What I need help with right now is: 1) How to display a layout over the current Activity 2) How make the background (the Activity) modal

Could someone point me to some tutorials/resources and/or give me a few tips?


use an Animation. here is a small tutorial on them: http://developerlife.com/tutorials/?p=343

initially, the view you want to be modal must be placed where you want it to show up(and visibility set to gone).

use a translate animation to visually move the view from below the screen to halfway up the screen. once the animation starts, set visibility to visible

try disabling all views that the user should not be able to interact with after you have started the animation holding the calculator view

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜