---
title: "android在java中动态改变控件大小"
author: "羊咩咩"
date: "2013-11-16T20:19:13Z"
tags: []
categories: ["移动开发"]
slug: "android-java"
draft: false
lastmod: "2013-11-16T20:19:13Z"
id: 1975995
url: "https://dblog.iteye.com/blog/1975995"
---

在java代码如下：

```
ImageButton exitbot =(ImageButton) findViewById(R.id.exit);
ViewGroup.LayoutParams exitbotn = (ViewGroup.LayoutParams)exitbot.getLayoutParams();
exitbotn.width = botwidth;
exitbotn.height = botheight;
```