2012-10-16 85 views
2

我在这里有一个小小的android项目有一个小问题。每当我加载一个特定的项目,VS会在几秒钟后崩溃。好吧......我已经将每个类添加到一个新项目中,并将其打开以查看VS崩溃的时间,但我发现,这些类不是问题,这些布局使VS崩溃。接下来的两个(几乎完全相同)的代码使其崩溃。你能告诉我他们有什么问题吗?Visual Studio由于Android布局而崩溃

<?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:layout_height="fill_parent" 
    android:minWidth="25px" 
    android:minHeight="25px"> 
    <TableLayout 
     android:minWidth="25px" 
     android:minHeight="25px" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/tableLayout1"> 
    <TableRow 
     android:id="@+id/tableRow1"> 
     <TextView 
      android:text="@string/lbEqID" 
      android:textAppearance="?android:attr/textAppearanceSmall" 
      android:layout_column="0" 
      android:id="@+id/lbEqID" /> 
     <TextView 
      android:text="Small Text" 
      android:textAppearance="?android:attr/textAppearanceSmall" 
      android:layout_column="2" 
      android:id="@+id/lbEqIDVar" /> 
    </TableRow> 
    <TableRow 
     android:id="@+id/tableRow2"> 
     <TextView 
      android:text="@string/lbEqDesc" 
      android:textAppearance="?android:attr/textAppearanceSmall" 
      android:layout_column="0" 
      android:id="@+id/lbEqDesc" /> 
     <TextView 
      android:text="Small Text" 
      android:textAppearance="?android:attr/textAppearanceSmall" 
      android:layout_column="2" 
      android:id="@+id/lbEqDescVar" /> 
    </TableRow> 
    <TableRow 
     android:id="@+id/tableRow3"> 
     <TextView 
      android:text="@string/lbTaskID" 
      android:textAppearance="?android:attr/textAppearanceSmall" 
      android:layout_column="0" 
      android:id="@+id/lbTaskID" /> 
     <TextView 
      android:text="Small Text" 
      android:textAppearance="?android:attr/textAppearanceSmall" 
      android:layout_column="2" 
      android:id="@+id/lbTaskIDVar" /> 
    </TableRow> 
    <TableRow 
     android:id="@+id/tableRow4"> 
     <TextView 
      android:text="@string/lbTaskDesc" 
      android:textAppearance="?android:attr/textAppearanceSmall" 
      android:layout_column="0" 
      android:id="@+id/lbTaskDesc" /> 
     <TextView 
      android:text="Small Text" 
      android:textAppearance="?android:attr/textAppearanceSmall" 
      android:layout_column="2" 
      android:id="@+id/lbTaskDescVar" /> 
    </TableRow> 
    <TableRow 
     android:id="@+id/tableRow5"> 
     <TextView 
      android:text="@string/lbTaskDate" 
      android:textAppearance="?android:attr/textAppearanceSmall" 
      android:layout_column="0" 
      android:id="@+id/lbTaskDate" /> 
     <TextView 
      android:text="Small Text" 
      android:textAppearance="?android:attr/textAppearanceSmall" 
      android:layout_column="2" 
      android:id="@+id/lbTaskDateVar" /> 
    </TableRow> 
    </TableLayout> 
</LinearLayout> 

而这一次

<?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:layout_height="fill_parent"> 
    <TableLayout 
     android:minWidth="25px" 
     android:minHeight="25px" 
     android:id="@+id/tableLayout1" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content"> 
     <TableRow 
      android:id="@+id/tableRow2" 
      android:layout_width="wrap_content"> 
      <TextView 
       android:text="Small Text" 
       android:textAppearance="?android:attr/textAppearanceSmall" 
       android:id="@+id/textView1" 
       android:layout_column="0" /> 
      <TextView 
       android:text="Small Text" 
       android:textAppearance="?android:attr/textAppearanceSmall" 
       android:layout_column="2" 
       android:id="@+id/textView11" 
       android:layout_height="wrap_content" /> 
     </TableRow> 
     <TableRow 
      android:id="@+id/tableRow3" /> 
     <TableRow 
      android:id="@+id/tableRow4"> 
      <TextView 
       android:text="Small Text" 
       android:textAppearance="?android:attr/textAppearanceSmall" 
       android:layout_column="0" 
       android:id="@+id/textView12" /> 
      <TextView 
       android:text="Small Text" 
       android:textAppearance="?android:attr/textAppearanceSmall" 
       android:layout_column="2" 
       android:id="@+id/textView13" 
       android:layout_height="wrap_content" 
       android:layout_width="wrap_content" /> 
     </TableRow> 
     <TableRow 
      android:minWidth="25px" 
      android:minHeight="25px" 
      android:id="@+id/tableRow5" /> 
     <TableRow 
      android:id="@+id/tableRow6"> 
      <TextView 
       android:text="Small Text" 
       android:textAppearance="?android:attr/textAppearanceSmall" 
       android:layout_column="0" 
       android:id="@+id/textView26" /> 
      <TextView 
       android:text="Small Text" 
       android:textAppearance="?android:attr/textAppearanceSmall" 
       android:layout_column="2" 
       android:id="@+id/textView28" 
       android:layout_height="wrap_content" 
       android:layout_width="wrap_content" /> 
     </TableRow> 
     <TableRow 
      android:minWidth="25px" 
      android:minHeight="25px" 
      android:id="@+id/tableRow7" /> 
     <TableRow 
      android:id="@+id/tableRow8"> 
      <TextView 
       android:text="Small Text" 
       android:textAppearance="?android:attr/textAppearanceSmall" 
       android:layout_column="0" 
       android:id="@+id/textView27" /> 
      <TextView 
       android:text="Small Text" 
       android:textAppearance="?android:attr/textAppearanceSmall" 
       android:id="@+id/textView29" 
       android:layout_column="2" 
       android:layout_height="wrap_content" 
       android:layout_width="wrap_content" /> 
     </TableRow> 
    </TableLayout> 
</LinearLayout> 
+0

了解如何使用Visual Studio调试Visual Studio,并且应该获得有关崩溃的更多信息。 –

+0

调试自己?你能给我发个教程吗?我无法找到任何有用的信息...... – EaranMaleasi

+2

http://blogs.msdn.com/b/calvin_hsia/archive/2009/06/08/9711306.aspx –

回答

0

我已经看到了一些问题,但没有找到一个重复的样品。

鉴于这种看起来像一个bug,而不是一个编程问题:

登录这与Xamarin使用http://bugzilla.xamarin.com/[email protected]可重复的错误 - 他们应该将此用于在即将发布的固定,并在此期间可能能够协助解决方法。

+0

现在说是否引起碰撞还为时尚早由单声道错误。必须收集更多信息(如堆栈跟踪)。因为它是非常普遍的看到两个彼此的Visual Studio扩展冲突,我想@ user1713668打类似的东西。简单地调试Visual Studio应该会揭示更多关于崩溃的信息。 –

+0

我发现了一个非常类似的错误,我有...我会添加一个评论,并尝试以其他方式得到想要的结果。 https://bugzilla.xamarin.com/show_bug.cgi?id=7403 – EaranMaleasi

2

不幸的是VS真是说不出的问题,所以在这里找到解决的办法,你可以创建一个空的布局,并开始一个添加元素之一。在你的情况下,问题是,在每次的TableRow增加了两个TextViews与列0和2。如果你改变第二个栏为“1”,Visual Studio将不会崩溃,我的理解,这将是你所期望的布局。

+0

我现在没有更多的问题了。我放弃了整个布局(甚至是其他活动)并制定了新的布局。但感谢你的帮助。 – EaranMaleasi