BottomSheet растягивается на весь экран - PullRequest
0 голосов
/ 04 мая 2018

Я использую привязку данных для нижнего листа, но когда я добавляю

setContentView (binding.root)

растягивает макет на весь экран Если я удаляю setContentView , вид все равно отображается, но привязка отсутствует. Вот мой код:

val binding : BottomSheetStationViewBinding = DataBindingUtil.inflate(LayoutInflater.from(this),
            R.layout.bottom_sheet_view, null, false)
    binding.data = data
    setContentView(binding.root)

вот макет:

<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">

<data>
<variable
    name="data"
    type="com.example.Data"/>
</data>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:layout_behavior="@string/bottom_sheet_behavior"
    android:orientation="vertical"
    android:background="@android:color/white">

... 
</LinearLayout>
</layout>
...