0

我想将 a 设置Rect为 final 并将其设置为.top .left等,并且仅从中读取。是否可以在初始化时设置尺寸?

public static final Rect myRect = new Rect();
4

1 回答 1

1

根据评论,它是通过使用备用构造函数完成的:

public static final Rect myRect = new Rect(int left, int top, int right, int bottom);

查看文档

于 2013-04-24T16:33:43.530 回答