13_android实现多线程下载_界面实现

进度条这个东西可以给它创建一个布局。进度条叫ProgressBar.

ProgressBar这个就是进度条。

默认的安卓进度条是一个圈圈,一圈一圈转。


之前咱们把一个XML文件转化成一个View对象,用到一个方法inflate()。实际上咱们现在还要用的还是同一个方法。把item这个条目转化成一个View对象。这个View对象对应的就是一个ProgressBar.

View android.view.View.inflate(Context context, int resource, ViewGroup root)
 

Inflate a view from an XML resource. This convenience method wraps the LayoutInflater class, which provides a full range of options for view inflation.

Parameters:
context The Context object for your activity or application.
resource The resource ID to inflate
root A view group that will be the parent. Used to properly inflate the layout_* parameters.
See Also:
LayoutInflater
也就是说inflate()这个方法调用之后,要把这个item转化成一个View对象。如果你最后一个参数给它传进了一个ViewGroup,那么这个item转化的View对象就会作为ViewGroup的孩子,作为它的一个子View.
原文地址:https://www.cnblogs.com/ZHONGZHENHUA/p/7076542.html