小编Sus*_*bey的帖子

如何更改底部导航按钮上的活动点击?

我想在我现有的Android应用程序中使用底部导航栏,但问题是所有屏幕都是活动,是否可以加载活动而不隐藏底部导航栏.

示例: activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v4.widget.NestedScrollView
        android:id="@+id/myScrollingContent"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <!-- Your loooooong scrolling content here. -->

    </android.support.v4.widget.NestedScrollView>
    <com.roughike.bottombar.BottomBar
        android:id="@+id/bottomBar"
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:layout_gravity="bottom"
        app:bb_tabXmlResource="@xml/bottom_bar"
        app:bb_behavior="shy"/>

</android.support.design.widget.CoordinatorLayout>
Run Code Online (Sandbox Code Playgroud)

这是我的基础活动,

MainActivity.java

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);
        BottomBar bottomBar;
        bottomBar = (BottomBar) findViewById(R.id.bottomBar);
        bottomBar.setOnTabSelectListener(new OnTabSelectListener() {
            @Override
            public void onTabSelected(@IdRes int tabId) {
                if (tabId == R.id.matching) {
                    Log.i("matching","matching inside "+tabId);
                    Intent in=new Intent(getBaseContext(),Main2Activity.class);
                    startActivity(in);
                }else if (tabId == R.id.watchlist) …
Run Code Online (Sandbox Code Playgroud)

android android-layout android-fragments android-bottomnav

18
推荐指数
2
解决办法
3万
查看次数

如何在api 23及更少的搜索条上显示刻度线

我想在api低于24的离散搜索条上显示刻度线,我能够在上面的api 24上显示刻度线,因为属性,

android:tickMark="@drawable/tickmark"
Run Code Online (Sandbox Code Playgroud)

在API 24中介绍,请帮忙.

android android-layout

3
推荐指数
1
解决办法
1510
查看次数