TommyLemon / Android-ZBLibrary

🔥 Android MVP 快速开发框架,做国内 「示例最全面」「注释最详细」「使用最简单」「代码最严谨」的 Android 开源 UI 框架。 🔥 An Android MVP Framework with many demos, detailed documents, simple usages and strict codes.
Apache License 2.0
5.5k stars 1.38k forks source link

底部导航栏的选中后,颜色不修改 #53

Open BKmy1 opened 1 year ago

BKmy1 commented 1 year ago

环境信息

问题描述

关于下载代码后,启动后的首页底部导航栏选中图标颜色无法改变 错误信息

TommyLemon commented 1 year ago

调整 MainTabActivity 中 getTabSelectIds 对应组件的 背景/颜色 属性 https://github.com/TommyLemon/Android-ZBLibrary/blob/master/app/src/main/java/zblibrary/demo/activity/MainTabActivity.java#L85-L91

image

https://github.com/TommyLemon/Android-ZBLibrary/blob/master/app/src/main/res/layout/main_tab_activity.xml#L33-L41

image
BKmy1 commented 1 year ago

那我在这里设置的样式怎么控制呢,按你说的是不是要在新建一个xml文件控制不同图标样式呢 \

------------------ 原始邮件 ------------------ 发件人: "TommyLemon/Android-ZBLibrary" @.>; 发送时间: 2023年7月16日(星期天) 晚上10:23 @.>; 抄送: "银色 穿甲 @.**@.>; 主题: Re: [TommyLemon/Android-ZBLibrary] 底部导航栏的选中后,颜色不修改 (Issue #53)

调整 MainTabActivity 中 getTabSelectIds 对应组件的 背景/颜色 属性 https://github.com/TommyLemon/Android-ZBLibrary/blob/master/app/src/main/java/zblibrary/demo/activity/MainTabActivity.java#L85-L91

https://github.com/TommyLemon/Android-ZBLibrary/blob/master/app/src/main/res/layout/main_tab_activity.xml#L33-L41

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

TommyLemon commented 1 year ago

这样可以。 也可以直接把 earth_selector, xx_selector 里面的图标换掉, 以及 bottom_tab_tv 里引用到的 selector 里的颜色值换掉

https://github.com/TommyLemon/Android-ZBLibrary/blob/master/app/src/main/res/values/styles.xml#L37-L39

image

https://github.com/TommyLemon/Android-ZBLibrary/blob/master/ZBLibrary/src/main/res/color/black_to_white.xml

image
BKmy1 commented 1 year ago

我试过了,修改颜色值,依然存在无法渲染选中图标。模拟器上只有触发按下图标,没有改变选中图标。真机也一样。

------------------ 原始邮件 ------------------ 发件人: "TommyLemon/Android-ZBLibrary" @.>; 发送时间: 2023年7月17日(星期一) 晚上9:51 @.>; @.**@.>; 主题: Re: [TommyLemon/Android-ZBLibrary] 底部导航栏的选中后,颜色不修改 (Issue #53)

这样可以,也可以直接把 earth_selector, xx_selector 里面的图标换掉, bottom_tab_tv 里引用到的 selector 里的颜色值换掉

https://github.com/TommyLemon/Android-ZBLibrary/blob/master/app/src/main/res/values/styles.xml#L37-L39

https://github.com/TommyLemon/Android-ZBLibrary/blob/master/ZBLibrary/src/main/res/color/black_to_white.xml

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

TommyLemon commented 1 year ago

发下界面截屏和改动代码

BKmy1 commented 1 year ago

<?xml version="1.0" encoding="utf-8"?&gt;
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    ***@***.***/activity_page"&gt;

<!--    <RelativeLayout--&gt;
<!--        android:id="@+id/rlBottomTabTopbar"--&gt;
<!--        ***@***.***/topbar_bg"&gt;--&gt;

<!--        <TextView--&gt;
<!--            android:id="@+id/topbarTitle"--&gt;
<!--            ***@***.***/topbar_title"--&gt;
<!--            android:layout_centerHorizontal="true"--&gt;
<!--            ***@***.***/home"--&gt;
<!--            tools:ignore="InvalidId" /&gt;--&gt;
<!--    </RelativeLayout&gt;--&gt;

    <FrameLayout
        android:id="@+id/flMainTabFragmentContainer"
        ***@***.***/match_match"
        android:layout_weight="1"&gt;</FrameLayout&gt;

    <View ***@***.***/divider_horizontal_1px_gray" /&gt;

<!--    <include--&gt;
<!--        android:id="@+id/bottomLayout"--&gt;
<!--        ***@***.***/bottom_nav_layout"/&gt;--&gt;

    <LinearLayout
        ***@***.***/ll_horizontal_match_wrap"
        ***@***.***/topbar_height"
        ***@***.***/alpha_6" &gt;

        <!--        首页--&gt;
        <LinearLayout
            android:id="@+id/llBottomTabTab0"
            ***@***.***/bottom_tab_ll"
            android:layout_weight="1"&gt;

            <ImageView
                android:id="@+id/ivBottomTabTab0"
                android:layout_width="32dp"
                android:layout_height="32dp"
                ***@***.***/earth_selector" /&gt;

            <TextView
                android:id="@+id/tvBottomTabTab0"
                ***@***.***/bottom_tab_tv"
                ***@***.***/home" /&gt;
        </LinearLayout&gt;

        <!--        功能中心--&gt;
        <LinearLayout
            android:id="@+id/llBottomTabTab1"
            ***@***.***/bottom_tab_ll"
            android:layout_weight="1"&gt;

            <ImageView
                android:id="@+id/ivBottomTabTab1"
                android:layout_width="32dp"
                android:layout_height="32dp"
                ***@***.***/mail_selector" /&gt;

            <TextView
                android:id="@+id/tvBottomTabTab1"
                ***@***.***/bottom_tab_tv"
                ***@***.***/able" /&gt;
        </LinearLayout&gt;

        <!--        TODO 修改顺序--&gt;
        <!--        朋友圈--&gt;
        <LinearLayout
            android:id="@+id/llBottomTabTab4"
            ***@***.***/bottom_tab_ll"
            android:layout_weight="1"&gt;

            <ImageView
                android:id="@+id/ivBottomTabTab4"
                android:layout_width="48dp"
                android:layout_height="48dp"
                ***@***.***/add_selector" /&gt;

            <!--            <TextView--&gt;
            <!--                android:id="@+id/tvBottomTabTab4"--&gt;
            <!--                ***@***.***/bottom_tab_tv"--&gt;
            <!--                android:text="朋友圈" /&gt;--&gt;
        </LinearLayout&gt;

        <!--        聊天--&gt;
        <LinearLayout
            android:id="@+id/llBottomTabTab2"
            ***@***.***/bottom_tab_ll"
            android:layout_weight="1"&gt;

            <ImageView
                android:id="@+id/ivBottomTabTab2"
                android:layout_width="32dp"
                android:layout_height="32dp"
                ***@***.***/search_selector" /&gt;

            <TextView
                android:id="@+id/tvBottomTabTab2"
                ***@***.***/bottom_tab_tv"
                ***@***.***/talk" /&gt;
        </LinearLayout&gt;

        <!--        个人中心--&gt;
        <LinearLayout
            android:id="@+id/llBottomTabTab3"
            ***@***.***/bottom_tab_ll"
            android:layout_weight="1"&gt;

            <ImageView
                android:id="@+id/ivBottomTabTab3"
                android:layout_width="32dp"
                android:layout_height="32dp"
                ***@***.***/setting_selector" /&gt;

            <TextView
                android:id="@+id/tvBottomTabTab3"
                ***@***.***/bottom_tab_tv"
                ***@***.***/personal" /&gt;
        </LinearLayout&gt;
    </LinearLayout&gt;
</LinearLayout&gt;

------------------ 原始邮件 ------------------ 发件人: "TommyLemon/Android-ZBLibrary" @.>; 发送时间: 2023年7月22日(星期六) 下午5:29 @.>; @.**@.>; 主题: Re: [TommyLemon/Android-ZBLibrary] 底部导航栏的选中后,颜色不修改 (Issue #53)

发下界面截屏和改动代码

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>