---
title: "自定义流布局"
author: "luckldforever"
date: "2015-09-30T10:43:49Z"
tags: []
categories: ["移动开发"]
slug: "untitled"
draft: false
lastmod: "2015-09-25T09:49:27Z"
id: 2246089
url: "https://luckldforever.iteye.com/blog/2246089"
---

1.首先新建一个FlowLayout类，继承自ViewGroup
2.在onMeasure中根据child views计算出FlowLayout高度
3.在onLayout中对child Views进行布局