小编Aha*_*lik的帖子

单击一个按钮在android中顺时针旋转图像

我有一个要求,我有一个ImageView和一个按钮.

http://i1289.photobucket.com/albums/b509/salikclub/Rotate-Last-Start_zps0d2fced8.png

我想在单击按钮时旋转图像.我需要全屏图像.但是当我点击按钮时图像会旋转,但不会在全屏显示.请参阅以下链接.

http://i1289.photobucket.com/albums/b509/salikclub/Rotate-Last1_zps2ccb1326.png

之后,当我点击按钮图像时也会旋转.但是位置已更改且未全屏显示.

我的要求是,当我点击按钮时,图像将顺时针旋转并将全屏显示.我再次单击按钮图像必须顺时针旋转并全屏显示.同样,当我单击按钮时,图像必须旋转.

因此有人可以帮助我吗?如果你能给我一个示例代码或一个非常适合的链接.

这是我正在尝试的代码,

main.xml中

<merge xmlns:android="http://schemas.android.com/apk/res/android" >

    <ImageView
        android:id="@+id/imgView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="1"
        android:scaleType="fitXY"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:adjustViewBounds="true"
        android:src="@drawable/matterhorn"
        />

    <Button
        android:id="@+id/btnRotate"
        android:layout_width="65dp"
        android:layout_height="35dp"
        android:layout_gravity="bottom|left"
        android:layout_marginLeft="190dp"
        android:layout_marginBottom="15dp"
        android:layout_weight="1"
        android:background="@android:color/transparent"
        android:drawableLeft="@drawable/btn_icon_rotate"
        >
    </Button>

</merge>
Run Code Online (Sandbox Code Playgroud)

这是我的主要活动"MainActivity.java"

package com.imageview.rotate;

import android.os.Bundle;
import android.app.Activity;
import android.graphics.Matrix;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;

public class MainActivity extends Activity implements OnClickListener{

    private Button btnRotate;
    private ImageView imgview;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        imgview = (ImageView) findViewById(R.id.imgView); …
Run Code Online (Sandbox Code Playgroud)

android image-rotation imageview android-imageview

7
推荐指数
1
解决办法
1万
查看次数

如何从CefSharp 3打开本机浏览器中的链接

我需要在CefSharp 3的本机浏览器中打开一个链接.我需要在CefSharp 3的chrome浏览器中运行整个应用程序,除了表单.当我单击表单的链接按钮(例如 - 注册按钮.它有一个指向注册表单的链接)我需要在本机浏览器中打开此链接(例如 - Internet Explorer).

我们能在CefSharp中实现这一目标吗?

我搜索了谷歌以及堆栈溢出.但无法找到解决方案.

提前致谢.

.net c# wpf cefsharp

5
推荐指数
2
解决办法
7484
查看次数