Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chenxuehong/bottomLayout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

8 Commits

Repository files navigation

bottomLayout使用实例

MainActivity.xml布局

 <com.common.bottomlayout.view.NoScrollViewPager
 android:id="@+id/noScrollViewPager"
 android:layout_width="match_parent"
 android:layout_height="0dp"
 android:layout_weight="1"></com.common.bottomlayout.view.NoScrollViewPager>
 <View
 android:layout_width="match_parent"
 android:layout_height="0.3dp"
 android:background="@android:color/darker_gray"></View>
 <com.common.bottomlayout.view.BottomBarLayoutWithVP
 android:id="@+id/bottomBarLayout"
 android:layout_width="match_parent"
 android:layout_height="49dp"></com.common.bottomlayout.view.BottomBarLayoutWithVP>

java代码:

private BottomBarLayoutWithVP bottomBar;
@Override
protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);
 initView();
}
private void initView() {
 bottomBar = findViewById(R.id.bottom_bar);
 NoScrollViewPager viewPager = findViewById(R.id.fl_container);
 bottomBar.with(this)
 .setViewPager(viewPager)
 .setTextColor(Color.RED, Color.BLACK)
 .setTextSize(14)
 .setSmoothScroll(true)
 .addItemView("直播", R.drawable.zhibo_l, R.drawable.zhibo, LiveFragment.class)
 .addItemView("商城", R.drawable.shangcheng_l, R.drawable.shangcheng, ShoppingFragment.class)
 .addItemView("我的", R.drawable.wo_l, R.drawable.wo, MineFragment.class)
 .addStateListAnimatorForScale(1.0f, 0.88f, 50)
 .setUnreadMsgCountAtIndex(1,2)
 .build();
}
@Override
protected void onDestroy() {
 super.onDestroy();
 if (bottomBar != null) {
 bottomBar.clearCache();
 }
}

About

首页底部BottomLayout实例

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

Languages

AltStyle によって変換されたページ (->オリジナル) /