NavigationTabBar
NavigationTabBar copied to clipboard
Titles not working
Hi i've downloaded your demo app and use the example of the top horizontal tab bar on my app but the titles for the models are not been displayed in the app on any of the modes(all and active). Am using the exact example as above only that am not using the tab bar with a viewpager cause i want only the tab bar, I've tried this on your demo app in the same example as above removing the viewpager and it continues to work perfectly showing the titles but on my app is not showing the titles, just the icons. What could be the problem, if you need anything from me let me know. I really wanna use the dependency cause is nice
I also found this problem,but Layouts use LinearLayout can display
Yes, If layout is LinearLayout then title works fine.
Same bug here, my layout it is:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/content_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:showIn="@layout/activity_main"
tools:context="br.com.ecoleta.app.presentation.MainActivity"
>
<devlight.io.library.ntb.NavigationTabBar
android:id="@+id/navigation_tab_bar"
android:layout_width="72dp"
android:layout_height="match_parent"
app:ntb_bg_color="?attr/colorPrimaryDark"
app:ntb_inactive_color="@android:color/white"
app:ntb_active_color="#9C348F"
app:ntb_scaled="false"
app:ntb_swiped="true"
app:ntb_titled="true"
app:ntb_title_mode="all"
/>
</LinearLayout>
In my case, this is happening because it is vertically oriented?
just wrap a LinearLayout as a parent around NavigationTabBar . it would solve this issue.
@mehraf the NavigationTabBar already have a LinearLayout as parent in my case, so your solution does not apply for me, right?
@filipebezerra lookout for the orientation . just use a horizontal LinearLayout as parent for NTB. after that you can specify any parent for the existing LinearLayout .
@mehraf as I said earlier, this doesn't works buddy. I used the sample app to prove this.
I changed the orientation to vertically oriented and set the titles then the result:
The code:
<LinearLayout 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:orientation="vertical"
android:background="#423752"
>
<devlight.io.library.ntb.NavigationTabBar
android:id="@+id/ntb_vertical"
android:layout_width="match_parent"
android:layout_height="50dp"
app:ntb_preview_colors="@array/vertical_ntb"
app:ntb_title_mode="all"
app:ntb_titled="true"
/>
<android.support.v4.view.ViewPager
android:id="@+id/vp_vertical_ntb"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
/>
</LinearLayout>
And after that I changed to horizontally oriented and the result:
The code:
<LinearLayout 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:orientation="horizontal"
android:background="#423752"
>
<devlight.io.library.ntb.NavigationTabBar
android:id="@+id/ntb_vertical"
android:layout_width="50dp"
android:layout_height="match_parent"
app:ntb_preview_colors="@array/vertical_ntb"
app:ntb_title_mode="all"
app:ntb_titled="true"
/>
<android.support.v4.view.ViewPager
android:id="@+id/vp_vertical_ntb"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
/>
</LinearLayout>
Please somebody help me here, I'm trying to use this library to do what was supposed to do, but I can't do it. I need help from experts.
I encountered the same problem, when I use the demo in the vertical layout, title not work. Even if I used a LinerLayout as the parent layout
I debug found that the set mIsTitled to true, after the implementation of the program to the location of the map will be set when the isTitled false, so it does not show, what is the role of this code for what?
@GIGAMOLE can you help here please?
@filipebezerra I modify some code.may be help you. https://github.com/569258yin/NavigationTabBar
Thanks @569258yin, I'll wait PR to be accepted!
Hey any updates here?
I just tried, but vertical menu still no title -_-
Yeah, very sad guys. The PR was denied @569258yin?
at the sample, the title is showed because the library was edited. but in default library, that vertical menu still didnt show the title because the library not edited yet.
I have the same problem I load the library in the sample inside my project as a android module and work fine for title inside a vertical navigationTabBar