XML代码...
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/orange"
android:id="@+id/toolbar"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:title="Online Music and Vidio Player" />
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:id="@+id/drawerLayout"
>
<FrameLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/containerView">
//<<------------------------------------------->>>>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/as"
android:layout_width="match_parent"
android:layout_height="73dp"
android:orientation="horizontal"
android:gravity="center_vertical"
android:background="@color/black"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:weightSum="1"
android:visibility="visible"
android:layout_gravity="bottom">
<!-- Previous Button -->
<ImageButton
android:id="@+id/btnPrevious"
android:src="@drawable/btn_previous"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"/>
<!-- Backward Button -->
<!-- Play Button -->
<ImageButton
android:id="@+id/btnPlay"
android:src="@drawable/btn_play"
android:layout_width="155dp"
android:layout_height="wrap_content"
android:background="@null"
android:layout_weight="1.03" />
<!-- Forward Button -->
<!-- Next Button -->
<ImageButton
android:id="@+id/btnNext"
android:src="@drawable/btn_next"
android:layout_width="102dp"
android:layout_height="104dp"
android:background="@null" />
</LinearLayout>
//<<---------------------------------------------------->>
</FrameLayout>
<android.support.design.widget.NavigationView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:id="@+id/shitstuff"
app:itemTextColor="@color/black"
app:menu="@menu/drawermenu"
android:layout_marginTop="-24dp"
/>
</android.support.v4.widget.DrawerLayout>
</LinearLayout>
**The code inside the line is not visible... in my program. it is a
fragment activity. The linear layout inside the frame layout is visible only in the UI design while running not available**
最佳答案
只需将 FrameLayout
更改为 LinearLayout
即可:
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/containerView">
...
关于android - 线性布局在设计中可见但在运行时不可见?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38803249/