Toolbar disappears when using Vuforia versions below 4.4

旧街凉风 提交于 2019-12-25 06:43:00

问题


I am using the SDK Vuforia and testing on devices with version 4.4 below the toolbar disappears, the menu buttons are there but invisible where would be the correct buttons are visible. The drawerlayout button with recyclerview I use the side menu does not work in version below 4.4, and its icon disappears. With much effort can swipe to activate the side menu. Above this version of the menu functions and buttons are displayed. The following images and correct the problem and xml layouts.

camera_overlay.xml

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:layout_centerInParent="true">

    <ImageView
        android:id="@+id/ivLoading"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@anim/loading"/>

    <TextView
        android:id="@+id/tvLoading"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/loading"
        android:textSize="23sp"
        android:textStyle="bold"
        android:textColor="@color/primary_dark"
        android:gravity="center_horizontal"
        android:layout_marginTop="43dp" />

</LinearLayout>

</RelativeLayout>

toolbar.xml

<?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:minHeight="?attr/actionBarSize"
    android:background="?attr/colorPrimary"
    android:fitsSystemWindows="true"
    android:elevation="4dp"
    app:theme="@style/CustomActionBar"/>

main_activity.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/DrawerLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    android:elevation="7dp">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <include
            android:id="@+id/toolbar"
            layout="@layout/toolbar">
        </include>

        <FrameLayout
            android:id="@+id/fragContainer"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:tag="fragContainer" />

    </LinearLayout>

    <RelativeLayout
        android:layout_width="320dp"
        android:layout_height="match_parent"
        android:layout_gravity="start">

        <android.support.v7.widget.RecyclerView
            android:id="@+id/RecyclerView"
            android:layout_width="320dp"
            android:layout_height="fill_parent"
            android:layout_gravity="left"
            android:fitsSystemWindows="true"
            android:background="@color/primary"
            android:scrollbars="vertical">

        </android.support.v7.widget.RecyclerView>

        <LinearLayout
            android:id="@+id/footer_menu"
            android:layout_width="320dp"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:orientation="horizontal" >

            <ImageView
                android:id="@+id/ivFooter"
                android:layout_width="wrap_content"
                android:layout_height="35dp"
                android:layout_gravity="bottom|center"
                android:layout_margin="5dp"/>

        </LinearLayout>

    </RelativeLayout>

</android.support.v4.widget.DrawerLayout>

Edited 10/16/2015

I made a call on Vuforia forum to see if someone there could help me ... Inclusive has a test project to facilitate the location of the problem.


回答1:


As this link, the solution was found. The problem was organize the objects on the screen. With this following code could play the elements that disappeared in front of the preview camera.



来源:https://stackoverflow.com/questions/32870683/toolbar-disappears-when-using-vuforia-versions-below-4-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!