2015-07-03 21 views
0

您好我嘗試用WROK MaterialViewPager如何在工具欄中MaterialViewPager安卓LIB

添加更多的圖標,我可以安裝它(樣品版)。但我無法underestand它有關動作條和工具欄

,我與它相對於2問題:

1-這個模板有一個正確的推拉門,只有感人的權利(不喜歡這幅畫圖標)

工作

enter image description here

另外我想添加一些工具欄圖標。

但我不知道如何添加圖標!

請參閱mainactivity.java代碼:

protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.activity_main); 

     setTitle(""); 

     mViewPager = (MaterialViewPager) findViewById(R.id.materialViewPager); 

     toolbar = mViewPager.getToolbar(); 
     mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout); 

     if (toolbar != null) { 
      setSupportActionBar(toolbar); 

      final ActionBar actionBar = getSupportActionBar(); 
      if (actionBar != null) { 
       actionBar.setDisplayHomeAsUpEnabled(true); 
       actionBar.setDisplayShowHomeEnabled(true); 
       actionBar.setDisplayShowTitleEnabled(true); 
       actionBar.setDisplayUseLogoEnabled(false); 
       actionBar.setHomeButtonEnabled(true); 
      } 
     } 

如果我改變​​到如果(工具欄== NULL)滑動圖標會隱藏,只是一個向右的箭頭出現這樣的畫面:

enter image description here

我知道這不是一種魔法,但我檢查了所有java代碼和menu_main以及樣式文件夾中的所有文件。我不知道這個陣列在這裏怎麼樣?因爲項目中沒有任何工具欄或操作欄。以及如何添加更多圖標?

SO這是我的問題: 1-我該如何激活圖標滑動? 2-其中是'右箭頭'的來源,我如何添加更多圖標?

enter image description here

,我怎麼能保持這兩個圖標在 '1' 和 '2'!

回答

0

該圖標來自Google支持庫,根據Material設計進行放置和管理。

改變或做任何事情違反了材料設計原則。

它應該是默認的。