如何在Anko DSL布局中设置底部边距为FAB?

我在我的kotlin活动中使用Anko DSL布局。 我不能将底部边距设置为FAB。 正确的利润工作。

在这里输入图像说明

在我的活动

override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) (application as SamfantozziApp).dgaeacomponent().inject(this) InvoiceListKtActivityUI(_rxBus).setContentView(this) } 

我的Anko DSL布局InvoiceListKtActivityUI.kt

 class InvoiceListKtActivityUI (val _rxBus: RxBus): AnkoComponent{ override fun createView(ui: AnkoContext): View = with(ui){ return relativeLayout{ padding = dip(5) lparams { width = matchParent height = wrapContent margin = 5 } verticalLayout{ tabLayout{ lparams { width = matchParent height = wrapContent } id = R.id.tabs } viewPager{ lparams { width = matchParent height = matchParent } id = R.id.container } } floatingActionButton{ lparams { width = wrapContent height = wrapContent rightMargin = 40 //works bottomMargin = 40 //does not work alignParentBottom() alignParentRight() } imageResource = android.R.drawable.ic_input_add id = R.id.fabinvoice onClick{ _rxBus.send(InvoiceListFragment.ClickFobEvent()) } } } } } 

Kotlin language will be the best programming language for Android.