I need to create a TabWidget inside a Fragment. It should look like as in the attached image. The content of each Tab should be in a separate Fragment...
I think you just need to visit developer.android
Related
I need to use part of my activity layout in fragmnent, but I dont know how.
If I use overlaying FrameLayout, I will not have access to the elements behind it. And duplicate part of activity_main_layout in several fragments also is not good idea.
A fragment can't host an activity. Instead you can use nested fragments for this purpose. Fragment Inside Fragment
It looks like i need to use fragments with transparent container in the middle
I want create this design with ViewPager.
How can I customize viewpager and create this?
1. Create a Fragment and its layout XML with ImageView and right aligned TextView's for your Fragment page.
2. Use FragmentPagerAdapter or FragmentStatePagerAdapter to populate Fragment's on ViewPager.
3. For bottom Indicator follow below tutorial.
Here is a good tutorial:
http://www.androidhive.info/2016/05/android-build-intro-slider-app/
Hope this will help~
You need to implement Slider in android, app according you requirement.
There is an example on code
I want to make tabView inside a fragment. I have template from this and I want to place tabView inside one fragment. Can I implement this like implementation using activity? Any tutorial or advice about this case? Thank you.
Yes. You can use ViewPager and TabLayout
(see http://developer.android.com/training/animation/screen-slide.html)
There are two ways to add the tabs inside fragment:
TabLayout: Using this layout you can add tab in your fragment and also latest approach provided by android.
Tabhost- Using old tabhost layout. This approach is a depreciated approach. However it will also work with fragment properly.
For more reference you can check my example on GitHub-Material Navigation
In Xamarin, I currently have two different activities and I would like to combine these together and use a ViewPager.
One activity uses the following content view: SetContentView(Resource.Layout.MapWithOverlayLayout);
The second activity uses the following content view: SetContentView(Resource.Layout.HomeScreen);
Can I please have some help to code a simple ViewPager that can add the two above content views into a ViewPager and then show each of these content views via code?
Thanks in advance
For a ViewPager, you will need Fragments instead of Activities.
Here is how to implement a ViewPager with Fragments and different layouts: How to implement a ViewPager with different Fragments / Layouts
The basic idea is that you create a Fragment for every layout you have, and then inside your FragmentPagerAdapter, load the correct Fragment depending on which page you are currently on.
This is how I am doing it in my other post and sorry about not posting the same code here.
Take a look at those links. It will help for sure.
Android:How to create different view in ViewPager?
Its a pretty simple implementation. You can define your own layouts and then use it in the view pager.
Here's my other post where you can get what you want to achieve:
How to use swipe gesture in a view pager's page with android?
Hope this helps..:)
i have develop one application in which tab layout in main file now i would like to set tablayout inside 2nd number tab,so what thing can i do? help me.
its "tab inside tab"
I think you want to give sub-options while clicking on 2nd tab button. For that, why dont you create layout with 2-3 options as you wants. And make it visible/invisible based on the 2nd button's click.
You can make visible/invisible any view by using setVisibility(View.VISIBLE) and setVisibility(View.GONE) method.
I suppose you can't embed a TabHost inside another TabHost. You can do what #Paresh said. Implement your own view switching. If you want an entire Activity embedded - take a look at ActivityGroup or the Fragments framework which you can use through the Compatibility Framework. Good luck.