private void createBottomBanner(Context context) { mBottomBanner = new RelativeLayout(this.getContext()); mBottomBanner.setBackgroundResource(R.drawable.stone_bg); RelativeLayout.LayoutParams bottomBannerLP = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT); bottomBannerLP.width = LayoutUtil.getNavigationPanelWidth(); bottomBannerLP.height = LayoutUtil.getGalleryBottomPanelHeight(); bottomBannerLP.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); this.addView(mBottomBanner, bottomBannerLP); }