2
我使用水平snapping RecyclerView來顯示圖像。
<com.superup.smartshelf.view.SnappingRecyclerView
android:id="@+id/item_list"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_above="@id/show_camera" />
下面是如何將圖像縮放
private void updateViews() {
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
setMarginsForChild(child);
if (mScaleUnfocusedViews) {
float percentage = getPercentageFromCenter(child);
float scale = 2.5f - (2f * percentage);
child.setScaleX(scale);
child.setScaleY(scale);
}
}
}
如何按比例縮放該視圖內的圖像,當另一個UI元素被打開(EditText上的onfocus,例如)?需要用動畫來縮放它。
我很抱歉,我不明白的問題。 –