android:clipChildren 仍然有效吗?
android:clipChildren 仍然有效吗? 我有一个具有大小的 AbsoluteLayout 并将 ClipChildren 设置为 false。当我添加比 AbsoluteLayout 更大的子元素时,子元素仍然被剪裁。
有人能做到这一点吗?
使用Android 2.2(API级别8)
更新20-01-11:
我可以用RelativeLayout做一些类似的事情,但是android:clipChildren可以工作吗? 顺便说一句,我的应用程序不需要在 Android 2.2 之外的任何其他平台上运行。
Does the android:clipChildren still works?
I have a AbsoluteLayout with a size and set the clipChildren to false. When I add childeren that are bigger then the AbsoluteLayout the childeren are still clipped.
Anyone got this working?
Working with Android 2.2 (API level 8)
Update 20-01-11:
I can make something similiar with a RelativeLayout, but does the android:clipChildren work on that?
btw, it's not needed that my application needs to work on any other platform then Android 2.2.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
绝对布局已被弃用。我建议使用不同的东西。
http://developer.android.com/reference/android/widget/AbsoluteLayout。 html
编辑:回答您的评论:
被弃用意味着由于某种原因,他们停止了开发它。也许有更好的替代品,也许他们不喜欢它的工作方式。不管怎样,他们可能会在未来的版本中放弃这个布局(这意味着你的应用程序将无法在未来版本的 Android 中运行)。
替代方案:
框架布局:
http://developer.android.com/reference/android/widget/FrameLayout。 html
相对布局
您还可以使用相对布局。将每个视图与其父视图对齐,并根据需要设置左边距和上边距。 这可能是您最好的选择 IMO。我以前曾经这样做过并且效果相当好。
Absolute layout is deprecated. I suggest using something different.
http://developer.android.com/reference/android/widget/AbsoluteLayout.html
Edit: Answering to your comment:
Being deprecated means that for some reason, they stopped developing it. Maybe there's a better replacement, maybe they don't like the way it works. Anyway, they may drop this layout in future versions (which means your app won't be able to run in a future version of android).
Alternatives:
Frame Layout:
http://developer.android.com/reference/android/widget/FrameLayout.html
Relative Layout
You can also use a relative layout. Align every view by it's parent and set left and top margins as you wish. This may be your best option IMO. I've done this before and it worked reasonably well.
正如 Pedro 所说,此功能可能是在 AbsoluteLayout 弃用后添加的,因此如果尚未实现,它将永远无法工作。
至于评论“这意味着你的应用程序将无法在未来版本的 Android 中运行”,谷歌承诺永远不会出现这种情况。
及以后:
我想说它不会被删除是一个安全的赌注,但它也不会获得新的功能/修复。
As Pedro said, this feature may have been an addition that came after AbsoluteLayout's deprecation, so if it's not implemented already, it will never work.
As far as the comment "which means your app won't be able to run in a future version of android", Google has promised that this will NEVER be the case.
and later:
I'd say it's a safe bet to say it won't be removed, but it also won't get new features/fixes either.