Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个包含图像视图和几个文本视图的布局(带有背景图像)。最初,我想显示 ImageView 的一半图像,它的高度与布局背景相匹配。稍后,在运行时,当用户单击布局时,布局应展开并显示 ImageView 已满的动画。
将您的布局划分为子布局并使用视图的可见性。默认情况下,使您不需要的布局不可见,并且在您单击某些内容后使您的所有布局可见。
我得到了答案:我只是使用 android:android:scaleType="matrix"在 ImageView 中只显示一半的图像,但我应该硬编码 ImageView 的高度。
android:scaleType="matrix"