I created Swipe Views with Tabs following this official Android tutorial: http://developer.android.com/training/implementing-navigation/lateral.html
I'm using a FragmentPagerAdapter to make tabs fixed and all visible. I'm developing on two PCs, on the first one the tabs are fixed, but if I run the app from the second one, they aren't. The source code, libraries and the manifest file are exactly the same.
Have anyone encountered the same problem? Howcome the tabs are not fixed even if I'm using the FragmentPagerAdapter? I dropped all my business logic, cleared workspace to avoid some configuration issues but it didn't help :-(
(the tabs definitely fit onto the screen, there are 4 of them with small icons, no titles)
Found the cause of the problem. If the tabs don't fit on the screen, they are switched to be scrollable instead of fixed. One of my icons was larger than the others and I forgot to copy it from one PC to another so the difference made the tabs scrollable.
Related
Firstly, I would like to mention that since i am not sure of the terminology of the view that i am looking for so I shall try and explain the behaviour.
I am looking for build a screen with multiple tabs where the tab indicators do not fit all inside the screen so it is scrollable. This is fine but i want that when the scrolling happens, after the last tab indicator, the tab widget automatically shows the first tab indicator right after it. So kind of like a circular tab widget.
Could someone please give pointers on how this could be achieved in android.
Thanks,
Sunny
I'm not sure, since you're not so clear...but i think you're looking for this:
https://github.com/astuetz/PagerSlidingTabStrip
Sliding tabs like the ones in Google Play.
I'm using a ViewPager to host multiple views, and I want something to visually show where the user is currently located. I don't want to use PagerTitleStrip or PagerTabStrip cause I don't want titles.
I want something similar to the horizontal line in the default launcher of the Nexus 4 shown in here:
When you swipe left or right, there is a slightly bigger rectangle that shows your position relative to the pages.
How can I do this?
PS: I can't use any library cause the code is going to be written in C# with Xamarin, also can't use any Xamarin component cause license won't let it have any more components.
Use the ViewPagerIndicator Library. This has an option for your desire.
ADDITION
I found this official Xamarin ViewPagerIndicator Library. Maybe this would help.
So I'm using Garuma's FlyOutContainer class in my project (http://blog.neteril.org/blog/2013/04/19/fly-out-menu-xamarin-android/)
But I'm having trouble using the menu to change the content layout. Whenever I remove a view from the content layout and inflate another, it draws the entire content layout at 0, 0 so when the menu layout closes, it drags the content layout past the left edge of the screen as well!
I've been looking for answers and fiddling with this for days now, so I thought I'd ask if anyone here has run into this issue and fixed it as well.
Alternatively, a layout that I could hold static to switch between several other layouts might work as a solution, I just haven't been able to find one that could do so that worked with this FlyOutContainer.
Thanks in advance for any and all replies!
-Sibley
I suggest using the DrawerLayout which Google supplies in the Support.v4 packages, which shows the standardized version of the FlyOut/Sliding/NavMenu which has been implemented in various ways previously, including FlyOutMenu.
I have a sample showing both DrawerLayout and SlidingPaneLayout in my GitHub repo.
One thing to notice is that SlidingPaneLayout is not meant for navigation, while DrawerLayout is. The former is meant as a responsive design, where a Pane's visibility is toggled in portrait mode, while always visible in landscape mode.
I've been updating an Android app today which so far had a single TableLayout-based View. Now, I'd like to duplicate that View with another set of backing data, and use horizontal swiping to switch between both. At some point I'd also like to add a third "page" with a different TableLayout.
I haven't really found any good ways to get this going. I've been looking at http://developer.android.com/training/implementing-navigation/lateral.html, and I actually copied the code fragment for the Tabs Pattern with NAVIGATION_MODE_TABS. That results in a little dropdown widget being added to the View title in the action bar, but clicking it doesn't show the tabs I set up (with actionBar.addTab()). I'm also not sure how to set up the view (XML) code to stick the TableLayouts in there.
I should mention that I don't have to care for pre-4.0 Android for this, so compatibility is not (much of) an issue.
Try to Use ViewPager Widget you can find useful links on the web, this widget handle the horizontal swiping between views.
http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html
https://github.com/JakeWharton/Android-ViewPagerIndicator
http://blog.stylingandroid.com/archives/537#
I haven't really found any good ways to get this going.
Try ViewPager. Here is an Android Developers Blog post on ViewPager: http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html
Here is a small sample app using ViewPager: https://github.com/commonsguy/cw-omnibus/tree/master/ViewPager/Fragments
None of the other answers ended up helping much. However, this one is pretty good:
http://thepseudocoder.wordpress.com/2011/10/05/android-page-swiping-using-viewpager/
I am a new android developer, just tried something with Android Tablayout.
There are two tabs and one tab has a GridView and the other one has a DatePicker.
I created an activity and layout for each tab.
The problem is that when I switch to the gridView, the background is not refreshed, and the images are just drawn over the DatePicker, so through images, the DatePicker still can be seen. It really bothers me.
What should I do to have a clean background for imageView?
Steve
There is something wrong with your layouts if you are seeing that behavior. Here is a sample project showing multiple activities as the contents of tabs. Here is another sample project that takes the more efficient approach of just using Views as the contents of tabs. Hopefully, by examining these, you can see where things may be going wrong with your layouts.