2017-11-28 6 views

答えて

1

レイアウトのコード

<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    xmlns:android="http://schemas.android.com/apk/res/android"> 
    <RelativeLayout android:id="@+id/loading" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:gravity="center" 
     xmlns:android="http://schemas.android.com/apk/res/android"> 
     <ProgressBar 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:indeterminate="true" /> 
    </RelativeLayout> 
    <ListView android:id="@+id/list_view" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:visibility="gone" 
     xmlns:android="http://schemas.android.com/apk/res/android" /> 
</FrameLayout> 

Javaでコード

private void finishLoadList(){ 
    RelativeLayout loadingLayout = (RelativeLayout) findViewById(R.id.loading); 
    ListView listView = (ListView) findViewById(R.id.list_view); 

    loadingLayout.setVisibility(View.GONE); 
    listView.setVisibility(View.VISIBLE); 
} 
関連する問題