monodevelop ti android development를 사용합니다. 인터넷에서로드하는 목록의 끝에로드하는 항목을 추가하고 싶습니다. 나는 제안이이 XML 파일을 사용레이아웃이 런타임에 제대로 표시되지 않습니다.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="125dp">
<RelativeLayout
android:id="@+id/LoadingRealtive"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dip"
android:background="@drawable/List_Menu_Bg"
>
<ProgressBar
android:id="@+id/loadingListItems"
style="@style/GenericProgressIndicator"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" />
<TextView
android:text="Loading..."
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/loadingListItems"
android:id="@+id/textView1"
android:layout_centerHorizontal="true"
android:textColor="#6b6b6b" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/MainRelative"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dip"
android:background="@drawable/List_Menu_Bg">...MyListItems </RelativeLayout></LinearLayout>
을 내 목록보기에이 코드를 사용 :
public override View GetView (int position, View convertView, ViewGroup parent)
{
View vi = convertView;
try {
if (convertView == null)
vi = activity.LayoutInflater.Inflate (Resource.Layout.list_row, parent, false);
RelativeLayout LoadingRelative=(RelativeLayout) vi.FindViewById (Resource .Id.LoadingRealtive);
RelativeLayout ContentRelative=(RelativeLayout) vi.FindViewById (Resource .Id.MainRelative);
if(Data [position ] == null)
{
ContentRelative .Visibility =ViewStates.Gone ;
LoadingRelative .Visibility = ViewStates.Visible ;
}else{
ContentRelative .Visibility =ViewStates.Visible ;
LoadingRelative .Visibility = ViewStates.Gone ;<...MyListCodes...>
}
} catch (Exception ex) {
Common.HandleException (ex);
}
return vi;
}
그것은 로딩 레이아웃로드가 수행해야합니다 동안 wrap_content이다 멋지군이 문제를 일을 fill_parent를로드하십시오. 이유가 무엇인지 이해가 안됩니까? 어떤 몸이라도 나를 도와 줄 수 있습니까?
하지만 당신은 높이 125dip가 될 수를 제공 한 ?? –
폭이 – user1682893