如何设置android:orientation ="horizontal"以编程方式在RelativeLayout中? [英] How to set android:orientation="horizontal" programmatically in RelativeLayout?
本文介绍了如何设置android:orientation ="horizontal"以编程方式在RelativeLayout中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何像这样在RelativeLayout中以编程方式设置android:orientation ="horizontal":
How to set android:orientation="horizontal" programatically in RelativeLayout like so:
<RelativeLayout
android:id="@+id/ID"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
</RelativeLayout>
这是我到目前为止所拥有的:
This is what I have so far:
RelativeLayout rLayout = new RelativeLayout(getActivity());
LayoutParams layoutParams;
layoutParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
rLayout.setLayoutParams(layoutParams);
推荐答案
您可以在文档中看到,RelativeLayout
没有orientation
参数.
这篇关于如何设置android:orientation ="horizontal"以编程方式在RelativeLayout中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文