android - Is it possible to add an inderminate progressbar within a TableLayout? -
i have scroll view contains tablelayout child view. while receving data server i'd display progress bar on screen. when data received progress bar must replaced tablerows.
i able achieve partially. add progressbar view 3rd row (row 1 , 2 headers) has visibility gone once data received , tablerows created.
the issue progress bar appears @ top of screen. consistent app, progress bar must in middle of screen have on listviews.
here code snippet progressbar
`<tablerow android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_horizontal"> <progressbar android:id="@+id/list_progressbar" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerinparent="true"/> </tablerow>
have tablelayout inside put tablerows hope doing, including 1 progressbar, instead of going replace.
you can achieve other way, make view.gone of tablerow containing progressbar, , view.visible of tablerow want show.
for example;
<tablelayout> <tablerow android:id="@+id/trheader1" .../> <tablerow android:id="@+id/trheader2" .../> <!-- keeping visibility of gone //--> <tablerow android:id="@+id/trrow3" android:visibility="gone" .../> <!-- tr containing progressbar //--> <tablerow android:id="@+id/trprogressbar" .../> </tablelayout>
as recieve data
((tablerow) findviewbyid(r.id.trrow3)).setvisibilty(view.visible); ((tablerow) findviewbyid(r.id.trprogressbar)).setvisibilty(view.gone);
so, hope work you. thanks!
Comments
Post a Comment