FILL_PARENT无效的问题

hl0702xin 2011-12-18 10:17:26
public ScrollLayout(Context context, AttributeSet attrs) {
super(context, attrs);
Scroller = new Scroller(context);
setLayoutParams(new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.FILL_PARENT));

}

这里我写了一个类 ScrollLayout继承于ViewGroup,在包com.main下面.
然后我在布局文件里面
<com.main.ScrollLayout
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:scrollbars="vertical" android:scrollbarSize="0dip"
android:id="@+id/mScrollLayout" android:fadeScrollbars="false"
android:fadingEdge="none" android:fadingEdgeLength="0dip"
android:layout_weight="1" android:fillViewport="true">
</com.main.ScrollLayout>
无法全屏啊,有可以指教的吗?
...全文
199 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
j_f0001 2011-12-19
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 birdsaction 的回复:]

ScrollLayout 这个可能已经全屏了,你可以加一个 背景颜色 验证一下。
[/Quote]这个也有可能。不过还是要提醒 一下,一个界面最好不能用两个滚动组件存在,否则会出现一些奇怪的问题
Birds2018 2011-12-19
  • 打赏
  • 举报
回复
ScrollLayout 这个可能已经全屏了,你可以加一个 背景颜色 验证一下。

80,350

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧