使用MvvmCross在MonoDroid中创建基于选项卡的界面

时间:2013-04-24 19:52:18

标签: android mvvmcross

我是Android开发的新手。我实际上正在使用MonoDroid和MvvmCross开发应用程序。我正在尝试创建一个基本的选项卡式界面。我看到了example。但是,它似乎过时了(也许我不对)。

有谁知道我在哪里可以看到MvvmCross标签界面的示例?目前,我有以下基本布局代码:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:background="#fff"
    android:layout_height="fill_parent">
    <TabHost
        android:minWidth="25px"
        android:minHeight="25px"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:id="@+id/theTabHost">
        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:id="@+id/linearLayout2">
            <TabWidget
                android:id="@android:id/tabs"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" />
            <FrameLayout
                android:id="@android:id/tabcontent"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content">
                <LinearLayout
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:id="@+id/linearLayout3" />
                <LinearLayout
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:id="@+id/linearLayout4" />
                <LinearLayout
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:id="@+id/linearLayout5" />
            </FrameLayout>
        </LinearLayout>
    </TabHost>
</LinearLayout>

不幸的是,这不能正常工作。

1 个答案:

答案 0 :(得分:1)

您的链接指向'master',这是mvvmcross的第一个版本。

对于较新版本 - v3 - 尝试使用v3替换主控 - https://github.com/slodge/MvvmCross/blob/v3/Sample%20-%20CirriousConference/Cirrious.Conference.UI.Droid/Views/HomeView.cs


另一个标签样本位于v3中的“教程” - https://github.com/slodge/MvvmCross/blob/v3/Sample%20-%20Tutorial/Tutorial/Tutorial.UI.Droid/Views/Lessons/CompositeView.cs

一个非常现代的样本 - 使用片段 - 在https://github.com/slodge/MvvmCross-Tutorials/blob/master/Fragments/FragmentSample.UI.Droid/Views/TabView.cs


对于master(v1),vnext(v2)和v3命名混淆感到抱歉 - 我很快就会更改这些名称。

相关问题