构建一个像纽约时报应用程序一样的 Android 状态栏

发布于 2024-11-18 22:33:27 字数 525 浏览 4 评论 0 原文

《纽约时报》Android 应用程序的顶部有一个类似通知栏的东西。

我怀疑这是一个包含文本视图的布局。问题是,他们设法把标题拉下来,以呈现头条新闻。

谁能提供有关如何复制此内容的任何见解?

编辑:

是的,抽屉是我问题的解决方案,但我需要一个,因为纽约时间,默认的 SlidingDrawer 只能从下到上......所以我在 St Google 上查看并得到了一个不错的自定义组件滑动抽屉,在我需要的时候让它工作有些困难,但你可以按照自定义 SlidingDrawer 的布局定位问题

纽约时报 Android 通知栏

The New York Times Android application has something like a notification bar at the top.

I suspect this is an included layout with a text view. The thing is that they managed to drag that title down in order to present the top news.

Can anyone give any insight on how to replicate this?

Edit:

Yes the drawer was the solution to my problem nevertheless i needed one as New York time and the default SlidingDrawer are meant to only go bottom to top... so i looked over on St Google and got a nice Custom Componente Sliding Drawer, get some difficult to make it work as i need it but you can follow the case in Layout positioning problem with Custom SlidingDrawer

New York Times Android notification bar

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

冰魂雪魄 2024-11-25 22:33:27

我认为您正在寻找的是滑动抽屉。

http://developer.android.com/reference/android/widget/SlidingDrawer.html

编辑:

我发布的链接对于文档很有用,但可能无法完全了解实际发生的情况。查找示例的好地方可能是这里:

http:// techdroid.kbeanie.com/2009/08/android-sliding-drawer-example.html

I think what you're looking for is a Sliding Drawer.

http://developer.android.com/reference/android/widget/SlidingDrawer.html

edit:

the link I post is good for the documentation, but might not give a full idea of what is actually happening. A good place to find an example might be here:

http://techdroid.kbeanie.com/2009/08/android-sliding-drawer-example.html

话少心凉 2024-11-25 22:33:27

正如您所说,他们很可能只是使用了 TextView。可以通过多种方式将其向下移动。最简单的方法是在其顶部放置另一个视图或视图组,并最初将其可见性设置为消失,然后在您想要显示它时将其设置为可见。

抱歉,我误解了你的意思。由于顶部元素是如此之小,我只是认为您的意思是您想要在另一个元素之上公开一个元素。我会对另一个答案进行投票,因为这很可能就是您想要的:)

They have most likely just used a TextView as you said. Moving it down can be done in multiple ways. The simplest is just to have another view or view group in top of it and initially set its visibility to gone, and then to visible when you want to show it.

Sorry, i misunderstood what you meant. Since the top element was so small, i simply thought you meant you wanted to expose a element on top of the other element. Ill up vote the other answer since this is most likely what you are after :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文