2016-12-23 3 views
0

In meinem Emulator, es bläst meine Ansicht mit 10 Zeilen wie es soll, aber wenn ich es auf meinem Gerät (Galaxy S4 v6.0) läuft zeigt es nur 2. I war Android v7.0 auf meinem Handy, aber auf v6.0 heruntergestuft, um zu sehen, ob das das Problem ist, aber das hat es nicht behoben. Das Ausführen auf Debug oder Release ändert nichts.RecyclerView zeigt nur die ersten beiden Zeilen auf meinem Gerät

button2nd.Click += async (_, __) => 
      { 
       await mclass.GetSummonerInformation(); 
       iconUrl = string.Format("http://ddragon.leagueoflegends.com/cdn/6.24.1/img/profileicon/" + MyClass.sumProfileIconId + ".png"); 
       DisplaySummonerIcon(iconUrl, imageView1); 
       await mclass.GetSummonerMatchList(); 
       function1(); 

      }; 

private void function1() 
     { 
      game.Clear(); 
      mAdapter.NotifyDataSetChanged(); 
      Thread.Sleep(1000); 
      System.Diagnostics.Debug.WriteLine("This is from the recentgamesdoworkcompleted"); 
      for (int i = 0; i < 10; i++) 
      { 
       if (mclass.win[i]) 
       { 
        winorlose = Color.ParseColor("#42A5F5"); 
       } 
       else 
       { 
        winorlose = Color.ParseColor("#D32F2F"); 

       } 
       System.Diagnostics.Debug.WriteLine("This is from inside the loop of recentgamesdoworkcompleted"); 
       game.Add(new Models.MatchHistoryListView() 
       { 
        Name = "" + mclass.summonerId[0, i], 
        ChampionId = mclass.championId[0, i], 
        Id = i, 
        Score = mclass.summonerScoreText[i], 
        championPortraito = new Uri("http://ddragon.leagueoflegends.com/cdn/6.24.1/img/champion/" + mclass.championName[0, i] + ".png"), 
        Item0 = new Uri("http://ddragon.leagueoflegends.com/cdn/6.24.1/img/item/" + mclass.summonerItems[i, 0] + ".png"), 
        Item1 = new Uri("http://ddragon.leagueoflegends.com/cdn/6.24.1/img/item/" + mclass.summonerItems[i, 1] + ".png"), 
        Item2 = new Uri("http://ddragon.leagueoflegends.com/cdn/6.24.1/img/item/" + mclass.summonerItems[i, 2] + ".png"), 
        Item3 = new Uri("http://ddragon.leagueoflegends.com/cdn/6.24.1/img/item/" + mclass.summonerItems[i, 3] + ".png"), 
        Item4 = new Uri("http://ddragon.leagueoflegends.com/cdn/6.24.1/img/item/" + mclass.summonerItems[i, 4] + ".png"), 
        Item5 = new Uri("http://ddragon.leagueoflegends.com/cdn/6.24.1/img/item/" + mclass.summonerItems[i, 5] + ".png"), 
        Item6 = new Uri("http://ddragon.leagueoflegends.com/cdn/6.24.1/img/item/" + mclass.summonerItems[i, 6] + ".png"), 
        listViewColor = winorlose 



       }); 


      } 
     } 

Main.axml hier

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
      android:nestedScrollingEnabled="false"> 
    <LinearLayout 
     android:orientation="vertical" 
     android:layout_height="wrap_content" 
     android:layout_width="wrap_content"> 
     <LinearLayout 
      android:orientation="vertical" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent"> 
      <Button 
       android:text="Get Summoner Information" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:id="@+id/button1" /> 
      <LinearLayout 
       android:orientation="horizontal" 
       android:layout_width="378.5dp" 
       android:layout_height="49.0dp" 
       android:id="@+id/linearLayout1"> 
       <Spinner 
        android:id="@+id/spinner1" 
        android:layout_width="81.0dp" 
        android:layout_height="41.0dp" /> 
       <EditText 
        android:inputType="textPersonName" 
        android:id="@+id/editText1" 
        android:hint="Type your username here!" 
        android:layout_width="295.5dp" 
        android:layout_height="match_parent" /> 
      </LinearLayout> 
      <ImageView 
       android:layout_width="250.5dp" 
       android:layout_height="113.5dp" 
       android:id="@+id/summonerIcon1" 
       android:visibility="visible" 
       android:layout_gravity="center" /> 
      <TextView 
       android:textAppearance="?android:attr/textAppearanceLarge" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:id="@+id/textView1" 
       android:text="Summoner Information" 
       android:gravity="center" /> 
      <TextView 
       android:text="Name:" 
       android:textAppearance="?android:attr/textAppearanceMedium" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:id="@+id/nameText" /> 
      <TextView 
       android:text="User Id:" 
       android:textAppearance="?android:attr/textAppearanceMedium" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:id="@+id/userIdText" /> 
      <TextView 
       android:text="Revision Date:" 
       android:textAppearance="?android:attr/textAppearanceMedium" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:id="@+id/revisionDateText" /> 
      <Button 
       android:text="Get Mach History" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:id="@+id/matchList" /> 
      <Button 
       android:text="Show Last Game info" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:id="@+id/lastGameInfoBtn" /> 
     </LinearLayout> 
     <android.support.v7.widget.RecyclerView 
      android:minWidth="25px" 
      android:minHeight="25px" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:id="@+id/recyclerView" 
      android:nestedScrollingEnabled="false"/> 
    </LinearLayout> 
</ScrollView> 
+0

Ich würde vermuten, dass Ihre "View" nur Platz für 2 Elemente hat, um die Eltern zu füllen. Daher müssten Sie mehr Code wie Ihre Layout-XML-Datei bereitstellen. –

+0

Scheint das NestedScrollingEnabled zu sein, das fehlerhaft ist.Das Aktivieren ermöglicht es mir, durch die Recycler-Ansicht zu scrollen, die sich am unteren Rand des Layouts befindet, aber ich muss es strecken und alle seine Elemente anzeigen.Entfernen gibt nicht mein gewünschtes Aussehen.Aktualisiert meine OP. –

Antwort

0

es behoben, durch NestedScrollView von Android.Support.v4 verwenden, da es ein bekannter Fehler in API 23 und API ist 24, die das Problem verursacht, dass ich erlebt wurde.

Verwandte Themen