2016-07-28 5 views
-1

にギロチンメニューを使用する場合、私は私のアプリでは、このナビゲーションドロワーを使用したい - GuillotineMenu-Android どのようにAndroidの

私はgithubのページ上の説明を読んで私のアプリにそれを適用する方法を見つけ出すことができませんしています。ここで

は私activity_mainです: - 次のように

<?xml version="1.0" encoding="utf-8"?> 

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

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

<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="Hello World!" /> 
</LinearLayout> 

マイツールバーのレイアウトは次のとおりです。 - 以下のように

<?xml version="1.0" encoding="utf-8"?> 
<android.support.v7.widget.Toolbar android:layout_width="match_parent" 
android:layout_height="wrap_content" 
android:id="@+id/toolbar" 
android:minHeight="?attr/actionBarSize" 
android:background="?attr/colorPrimary" 
local:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
local:popupTheme="@style/ThemeOverlay.AppCompat.Light" 
xmlns:local="http://schemas.android.com/apk/res-auto" 
xmlns:android="http://schemas.android.com/apk/res/android" /> 

私Mainactivity.javaは次のとおりです。 -

import android.support.v7.app.AppCompatActivity; 
import android.os.Bundle; 
import android.support.v7.widget.Toolbar; 

import com.yalantis.guillotine.animation.GuillotineAnimation; 

public class MainActivity extends AppCompatActivity { 
Toolbar toolbar; 

@Override 
protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.activity_main); 
    toolbar= (Toolbar) findViewById(R.id.app_bar); 
    toolbar.setNavigationIcon(R.mipmap.hamburgr_icon); 
    setSupportActionBar(toolbar); 


} 
} 

そして、ナビゲーション・ドロワーに表示したいメニューは次のとおりです。 -

<?xml version="1.0" encoding="utf-8"?> 
<menu xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto"> 
<group android:checkableBehavior="single"> 
    <item 
     android:id="@+id/nav_first_fragment" 
     android:title="first" /> 
    <item 
     android:id="@+id/nav_second_fragment" 
     android:title="second" 

     /> 
    <item 
     android:id="@+id/nav_third_fragment" 
     android:title="Third" /> 
</group> 


<item 
    android:id="@+id/contact_us" 
    android:title="Contact Us"/> 



</menu> 

私はすでにGuillotineMenu-AndroidライブラリをAndroidスタジオにインポートしましたが、使用方法を理解できません。誰かが私にそれをどのように使用するか教えてもらえると莫大な助けになるでしょう。

ありがとうございます。

+0

あなたが提供GitHubのレポのリンクを – SMR

+0

が壊れています(しかし、私のために働いています。とにかく、ここにリンクがあります - https://github.com/Yalantis/GuillotineMenu-Android –

答えて

1
関連する問題