在android中将图像部分移出屏幕

我在 android中有一个 ImageView.我想在屏幕内部分移动图像,使得只有部分图像可见.如果我在xml中设置边距或填充,图像会缩小.我在onCreate方法中使用了translate Animation.但是我看到第一次出现视图时图像会移动.我希望图像部分可见,而不会看到移位.有没有办法做到这一点?

解决方法

在父视图中(如LinearView)设置ClipChildrens = false,如果您正在寻找

检查这段代码,它对我有用……

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="right"
        android:layout_marginRight="-20dp"
        android:src="@drawable/ic_launcher" />

</FrameLayout>

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...