2013-04-24 69 views
0

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

有谁知道我在哪里可以看到与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

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

较新版本 - 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


很抱歉的主(V1),vnext(V2)和v3命名混乱 - 我将改变吨这些名字很快。

+0

也许我很愚蠢。但是,您的答案中的前两个链接似乎不起作用。同时,我似乎无法在github网站上对其进行逆向工程。它几乎就像目录结构发生了变化。 – 2013-04-26 17:09:56

+0

对不起 - 不是愚蠢 - 只是示例应用程序昨天移动 - 全部到https://github.com/slodge/MvvmCross-Tutorials/ - 他们将在未来再次移动到https://github.com/MvvmCross帐户 - Mvx的所有部分长大 – Stuart 2013-04-26 17:16:28

+0

酷。另外,我注意到你的名字都在这个地方。非常感谢你的辛勤工作。这是我能说的一个很棒的框架。 – 2013-04-27 12:50:08