---
title: "Inflater生成View"
author: "AndLi"
date: "2011-10-31T15:12:38Z"
tags: []
categories: ["移动开发"]
slug: "inflater-view"
draft: false
lastmod: "2011-10-31T15:12:38Z"
id: 1225064
url: "https://andli.iteye.com/blog/1225064"
---

```
LayoutInflater inflater = LayoutInflater.from(ReportPrice.this);// 渲染器
		LinearLayout view = (LinearLayout)inflater.inflate(R.layout.reportprice_item, null);
		
		TextView variety_text = (TextView) view.findViewById(R.id.variety_text);
		variety_text.setText(category); // 设置TextextViewiew显示的内容
		TextView format_text = (TextView) view.findViewById(R.id.format_text);
		format_text.setText(format);
		EditText price_editText = (EditText) view.findViewById(R.id.price_et);
		price_editText.setText(String.valueOf(id));
```