簡體   English   中英

React Native中的React導航圖標

[英]React Navigation Icon in React Native

我使用react-native-navigation在我的項目中創建導航,我需要放置圖像而不是圖標,這是我的代碼

 const startTabs = () => { Navigation.startTabBasedApp({ tabs: [ { screen: "awesome-places.Product", label: "first Icon", title: "first Icon", icon: require("../../../images/006-coffee-cup.png") }, { screen: "awesome-places.Bag", label: "Icon", title: "Icon" } ] }); }; 

結果就是這樣的藍色! 在此處輸入圖片說明

但是原始圖片是這樣的: 在此處輸入圖片說明

並且我需要保留圖像的顏色,那么我該怎么做呢?

我認為默認情況下,每個選中的圖標的背景色也會更改, “更改所有非透明像素的顏色”

嘗試添加具有相同圖像的selectedIcon

const startTabs = () => {
  Navigation.startTabBasedApp({
    tabs: [
      {
        screen: "awesome-places.Product",
        label: "first Icon",
        title: "first Icon",
        icon: require("../../../images/006-coffee-cup.png")
        selectedIcon: require("../../../images/006-coffee-cup.png")

      },
      {
        screen: "awesome-places.Bag",
        label: "Icon",
        title: "Icon"
      }
    ]
  });
};

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM