在我的模拟器中,它会像我想要的那样用10行充气我的视图但是当我在我的设备上运行它时(Galaxy S4 v6.0)它只显示2.我在我的手机上使用了android v7.0但是降级到v6.0以查看是否存在问题但是没有解决问题。在调试或发布时运行它不会改变任何东西。
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
<?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 :(得分:0)
通过使用Android.Support.v4中的NestedScrollView修复了它,因为API 23和API 24中存在一个已知错误导致我遇到的问题。