这个标题栏是怎么做出来的?
此屏幕取自 Aldiko E 图书阅读器。我真的很喜欢它的用户界面。图书列表可能是由具有自定义背景的列表视图制成的。但是标题栏是如何制作的呢?有了阴影等等?
This screen was taken from the Aldiko E book reader. I really love the UI. The book list was probably made from a listview with custom background. But how was the title-bar made? With the shadowing and all?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
关于阴影(如果您使用
Paint
)regarding the shadows if you work with
Paint
它看起来像
LinearLayout
(具有水平方向),其中TextView
的权重为 1,并且如上所述使用阴影层。至于
Books by Rating
,它可以是列表标题或插入到LinearLayout
中的另一个视图(垂直方向)。至于单个项目,它们都具有相同的背景可绘制对象,即 BitmapDrawable ,并且还具有用于分隔符/分隔符的 BitmapDrawable 。it looks like
LinearLayout
(having horizontal orientation) withTextView
having weight of 1 and as mentioned above using the shadow layer.As for the
Books by Rating
, it could be list header or another View inserted intoLinearLayout
(with vertical orientation). As for the individual item, they all have the same background drawable which isBitmapDrawable
and also havingBitmapDrawable
for the divider/separator.同样从 api 级别 11 开始,您有一个称为操作栏的元素。这将成为 Android 的新标准,值得一试。有关详细信息,请参阅此 Google 资源。
also from api level 11 and on you have an element called the Action Bar. This is going to be a new standard for Android so good to check it out. See this google resource for more info.
标题栏的背景是九个补丁 png (.9.png),顶部有透明父 png 图标。
9 片可以拉伸而不变形。
9补丁工具
The background of the title bar is a nine patch png (.9.png), with trans parent png icons on top.
A 9 patch can be stretched without distortion.
9 patch tool
它是使用 GitHub 中的 Green Droid 库制作的。 https://github.com/cyrilmottier/GreenDroid
It was made using the Green Droid library in GitHub. https://github.com/cyrilmottier/GreenDroid