保证金不影响在"包括" [英] Margin does not impact in "include"

查看:117
本文介绍了保证金不影响在"包括"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的文章的景色。它采用有,我试图让他们之间的一个小边距。 机器人:布局marginTop,似乎并没有对布局有任何影响。

 <的LinearLayout
        机器人:layout_width =match_parent
        机器人:layout_height =WRAP_CONTENT
        机器人:方向=垂直>
        <包括机器人:ID =@ + ID /第一条布局=@布局/ mainarticle/>
        <包括机器人:ID =@ + ID /第二条机器人:layout_marginTop =10dip布局=@布局/条/>
        <包括机器人:ID =@ + ID /第三条机器人:layout_marginTop =10dip布局=@布局/条/>
        <包括机器人:ID =@ + ID /第四条机器人:layout_marginTop =10dip布局=@布局/条/>
        <包括机器人:ID =@ + ID /第五条机器人:layout_marginTop =10dip布局=@布局/条/>
    < / LinearLayout中>
 

解决方案

您应该添加的android:layout_width 安卓layout_height 包括标签属性,否则利润率不采取考虑。

I have a view with articles. It uses "include", and I'm trying to make a little margin between them. "android:layout-marginTop" does not seem to have any impact on the layout.

<LinearLayout 
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >    
        <include android:id="@+id/article1" layout="@layout/mainarticle" />
        <include android:id="@+id/article2" android:layout_marginTop="10dip" layout="@layout/article" />
        <include android:id="@+id/article3" android:layout_marginTop="10dip" layout="@layout/article" />
        <include android:id="@+id/article4" android:layout_marginTop="10dip" layout="@layout/article" />
        <include android:id="@+id/article5" android:layout_marginTop="10dip" layout="@layout/article" />    
    </LinearLayout>

解决方案

You should add the android:layout_width and android:layout_height properties in the include tag otherwise the margins are not taken in consideration.

这篇关于保证金不影响在&QUOT;包括&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆