2017-07-08 8 views
0

GoogleサポートライブラリのBottomNavigationViewでカスタムビューを使用します。 は、私が見つかりましたところ、ロードビュー(android.support.design.internal.BottomNavigationItemView):サポートライブラリのレイアウトIDを上書きできますか?

public BottomNavigationItemView(Context context, AttributeSet attrs, int defStyleAttr) { 
     super(context, attrs, defStyleAttr); 
     final Resources res = getResources(); 
     int inactiveLabelSize = 
       res.getDimensionPixelSize(R.dimen.design_bottom_navigation_text_size); 
     int activeLabelSize = res.getDimensionPixelSize(
       R.dimen.design_bottom_navigation_active_text_size); 
     mDefaultMargin = res.getDimensionPixelSize(R.dimen.design_bottom_navigation_margin); 
     mShiftAmount = inactiveLabelSize - activeLabelSize; 
     mScaleUpFactor = 1f * activeLabelSize/inactiveLabelSize; 
     mScaleDownFactor = 1f * inactiveLabelSize/activeLabelSize; 

     LayoutInflater.from(context).inflate(R.layout.design_bottom_navigation_item, this, true); 
     setBackgroundResource(R.drawable.design_bottom_navigation_item_background); 
     mIcon = (ImageView) findViewById(R.id.icon); 
     mSmallLabel = (TextView) findViewById(R.id.smallLabel); 
     mLargeLabel = (TextView) findViewById(R.id.largeLabel); 
    } 

私はフォーククラスなしでこのレイアウトを置き換えることはできますか? design_bottom_navigation_itemレイアウトを置き換えますか?

答えて

-1

はい。それが可能だ。レイアウトフォルダにdesign_bottom_navigation_item.xmlを入れるだけです。

関連する問題