Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does LayoutInflater in Android do?

What is the use of LayoutInflater in Android?

like image 445
user386430 Avatar asked Aug 13 '10 13:08

user386430


People also ask

What is the use of LayoutInflater in Android?

Instantiates a layout XML file into its corresponding View objects. It is never used directly. Instead, use Activity.

What is LayoutInflater in Android Kotlin?

abstract class LayoutInflater. kotlin.Any. ↳ android.view.LayoutInflater. Instantiates a layout XML file into its corresponding android.

What does Inflater inflate do?

inflater.inflate will -Inflate a new view hierarchy from the specified xml resource. Throws InflateException if there is an error. In simple terms inflater. inflate is required to create view from XML .

What does it mean to inflate a view?

"Inflating" a view means taking the layout XML and parsing it to create the view and viewgroup objects from the elements and their attributes specified within, and then adding the hierarchy of those views and viewgroups to the parent ViewGroup.


1 Answers

The LayoutInflater class is used to instantiate the contents of layout XML files into their corresponding View objects.

In other words, it takes an XML file as input and builds the View objects from it.

like image 92
Pentium10 Avatar answered Sep 22 '22 00:09

Pentium10