是否有可能我的ImageView所有屏幕尺寸都适合没有图像看起来拉伸?
我尝试使用fill_parent> 将所有比例类型更改为背景和srcwrap_content
但仍然.如果图像不小,它只是看起来拉伸..
例:
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scaleType="centerInside"
android:adjustViewBounds="true"
android:background="@drawable/background" />
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:adjustViewBounds="true"
android:background="@drawable/background" />
Run Code Online (Sandbox Code Playgroud)
这两个适合宽度,但图像被拉伸..但当我将其更改为src时,图像只是居中和小.
我正在实施游戏中的练习比例动画.我正在关注所有指南,但总是发生一些奇怪的事情,而不是让对象更大.动画不仅使图像更大,而且即使我不使用翻译动画也会移动它...
这里是xml文件
<?xml version="1.0" encoding="utf-8"?>
<set android:shareInterpolator="false"
xmlns:android="http://schemas.android.com/apk/res/android">
<scale
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:fromXScale="1.0"
android:toXScale="1.4"
android:fromYScale="1.0"
android:toYScale="1.4"
android:pivotX="50%"
android:pivotY="50%"
android:fillAfter="false"
android:duration="1000" />
</set>
Run Code Online (Sandbox Code Playgroud)
在这里,它在java中调用
private void startAnimation(final ImageView imageView) {
final Animation popAnim = AnimationUtils.loadAnimation(getActivity(), R.anim.scalebounce);
imageView.startAnimation(popAnim);
popAnim.setAnimationListener(new AnimationListener() {
public void onAnimationStart(Animation animation) {
}
public void onAnimationRepeat(Animation animation) {
}
public void onAnimationEnd(Animation animation) {
imageView.clearAnimation();
imageView.setVisibility(View.GONE);
}
});
}
Run Code Online (Sandbox Code Playgroud)
它真的很奇怪我已经尝试了我在网上找到的所有解决方案,但没有运气它仍然会转换行为,即使它只是规模...我从小点制作图像然后它变得更大(正常大小).但我不希望它移动,只是为了取而代之.谢谢 :)
PS我一直在观察动画,它似乎需要更大的空间,这就是为什么它看起来像是在移动......为什么需要更大的空间?不是实际的图像尺寸?
嗨,我正在为Android sdk 3.5实现facebook分享对话框但是我没有取得任何成功我跟随指南..
FacebookDialog shareDialog = new FacebookDialog.ShareDialogBuilder(MyClass.this)
.setApplicationName("App Name")
.setName("Name")
.setLink("mylink")
.build();
Run Code Online (Sandbox Code Playgroud)
我把它放在我的触摸方法里面没有出现错误,但每当我点击按钮时......也没有出现〜
是MyClass.this错了吗?谢谢你的回复〜