android开发物理世界中水平移动怎么设置

android开发物理世界中水平移动怎么设置,第1张

代码中设置:

LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,

LayoutParams.FILL_PARENT)

params.setMargins(0, 5, 2, 0)

LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,

LayoutParams.FILL_PARENT)

params.setMargins(0, 5, 2, 0)

WindowManager windowManager = getWindowManager()

Display display = windowManager.getDefaultDisplay()

WindowManager.LayoutParams lp = getWindow().getAttributes()

lp.width = WindowManager.LayoutParams.MATCH_PARENT

lp.height = WindowManager.LayoutParams.MATCH_PARENT

getWindow().setAttributes(lp)

HorizontalScrollView hv = new HorizontalScrollView(context)hv.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT))hv.setFillViewport(true)hv.addView(listview)mainPanel.addView(hv)这样不管用郁闷ing。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/tougao/11172381.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-14
下一篇 2023-05-14

发表评论

登录后才能评论

评论列表(0条)

保存