Resource.ID does not contain TabWidget

I use MVVMCross in my app.

  public class MainView : MvxTabsFragmentActivity
  {
        public MainView()
        : base(Resource.Layout.Main, Resource.Id.actualtabcontent)
        {         }
        .....
  }

This is my view

  <LinearLayout
   xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:local="http://schemas.android.com/apk/res-auto"
   android:orientation="vertical"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent">
  <LinearLayout
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/LatestJobsContent">
    <TabHost
        android:id="@android:id/tabhost"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">
            <TabWidget
                android:id="@android:id/tabs"
                android:orientation="horizontal"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_weight="0" />
            <FrameLayout
                android:id="@android:id/tabcontent"
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:layout_weight="0" />
            <FrameLayout
                android:id="@+id/actualtabcontent"
                android:layout_width="fill_parent"
                android:layout_height="0dp"
                android:layout_weight="1" />
        </LinearLayout>
    </TabHost>
  </LinearLayout>

Resource.ID does not contain "tabs", and "tabhost" :(. I cleaned and rebuilt the solution but this ID not find.

Posts

  • CheesebaronCheesebaron DKInsider, University mod

    Do do tabs like that. It is super inefficient. Use a ViewPager + ViewPagerIndicator or whatever the Material design equivalents are.

    TabHost = Obsolete!

  • FetFrumos911FetFrumos911 USMember

    Please, give an example with MvvmCross.

  • CheesebaronCheesebaron DKInsider, University mod
    edited June 2015

    I have a video here. Still applicable.

    Also it is one of the first results on Google when you search for "ViewPager MvvmCross", but I guess you never did any research...

  • FetFrumos911FetFrumos911 USMember

    Thank you very much. It is work with ViewPager. I add ViewPagerIndicator (Library 4) in my project and get error:

    Attribute "fillColor" has already been defined
    Attribute "strokeColor" has already been defined
    Attribute "strokeWidth" has already been defined

    I use Xamarin version 3.9.236.

  • Martijn00Martijn00 NLInsider, University ✭✭✭

    @frodo17 there is a new example up using the new Tabs of the Android Design Library and bindable viewpager: https://github.com/MvvmCross/MvvmCross-AndroidSupport/tree/master/Samples

Sign In or Register to comment.