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.
Related
So, first of all I'm very new to Android so this may be a very dumb question, but..
I have in my mainActivity layout a viewPager which calls some fragments of different type (I have made 4-5 xml layout displaying different informations)
Despite I created all the layout basing on weighed LinearLayout to maximize compatibility, in the preview the visibility seems perfect in each device I selected, but once I load the application on my phone, the layout has bizarre behavior.
Here an example (preview vs. screenshot from my device)
I'm not sure about where I made the mistake, I would like to know:
1) What happened
2) What cause this behaviour
3) How to fix it (a link with a guide would be very welcome)
Thanks very much!
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 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.
I'm developing an application for android that is supposed to have three tabs that shows three different listviews. It should look pretty much like this video example:
http://www.androidhive.info/2012/05/android-combining-tab-layout-and-list-view/
The problem i have is that TabActivity is deprecated and i can't found any good tutorials for the Fragment view (which I think is the one to replace TabView). Anyone know how to combine these two views?
You might want to look into ActionBar and Fragments. Maybe the following link could help you out? http://www.lucazanini.eu/2012/android/tab-layout-in-android-with-actionbar-and-fragment/?lang=en
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/