2016-09-22 127 views
0

我的XML文件:在工具欄按鈕不起作用

<FrameLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/groupon_web"> 

    <WebView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:id="@+id/Groupon_webView" 
     android:layout_below="@+id/toolbar"/> 

    <android.support.v7.widget.Toolbar 
     android:id="@+id/toolbar" 
     android:layout_width="match_parent" 
     android:layout_height="?attr/actionBarSize" 
     android:background="?attr/colorPrimary" 
     app:popupTheme="@style/AppTheme.PopupOverlay"> 
    </android.support.v7.widget.Toolbar> 

    <Button 
     android:layout_width="65dp" 
     android:layout_height="65dp" 
     android:background="@drawable/not_favorite" 
     android:id="@+id/favorite" 
     android:layout_gravity="end|bottom" 
     android:layout_marginRight="20dp" 
     android:layout_marginEnd="20dp" 
     android:layout_marginBottom="40dp"/> 
</FrameLayout> 

但導航按鈕效果很好。我不知道爲什麼上面的webview按鈕根本不起作用。誰能幫我這個?謝謝!

+0

你是什麼意思不起作用?你的代碼在哪裏? – akiraspeirs

回答

0

把你的webview,工具欄和按鈕裏面的相對佈局。在你的框架佈局。使用相同的層次結構。