为StartApp广告添加保证金?

时间:2014-02-12 21:54:34

标签: android layout startapp

我最近将StartApp集成到了我的应用中。现在,我不希望广告是全尺寸的,我希望它们的每一边都有一小块余量。现在我对我的布局没有太大的改变,因为我正在使用libGDX,所以我之前不必关心XML文件。这就是我的main.xml的样子:

 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
 android:orientation="vertical" >

<com.startapp.android.publish.banner.Banner 
    android:id="@+id/startAppBanner"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
 />

</LinearLayout>

现在,我尝试了各种各样的事情,例如将android:layout_margin="10dp"android:padding="10dp"添加到BannerLinearLayout,但这并没有改变任何事情。所以我的问题是:有没有办法实现我正在寻找的东西,如果有,怎么样?

1 个答案:

答案 0 :(得分:0)

你应该对'layout_width'和'layout_height'使用'wrap_content',然后layout_margin应该可以工作。

以下适用于我:

<com.startapp.android.publish.banner.Banner 
    android:id="@+id/startAppBanner"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_margin="10dp"
/>