小编use*_*295的帖子

如何连续旋转图像?

我试图通过使用线程旋转此图像.我该怎么办?

     public class Start extends Activity {
        View base;
            Bitmap rotate, base1, rotate1;
        ImageView rotator;
        float angle, pivX, pivY;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.start);
            base = findViewById(R.id.base);
            rotator = (ImageView) findViewById(R.id.rotator);
            pivX = (rotator.getLeft()) / 2;
            pivY = (rotator.getTop()) / 2;
            Thread thread = new Thread() {
        @Override
        public void run() {
            for (angle = 0; angle < 50; angle++) {
                Matrix matrix = new Matrix();
                rotator.setScaleType(ScaleType.MATRIX); // required
                matrix.postRotate((float) angle, pivX, pivY);
                rotator.setImageMatrix(matrix);
                if (angle == …
Run Code Online (Sandbox Code Playgroud)

android android-animation android-imageview

11
推荐指数
3
解决办法
2万
查看次数

我可以在nth-child中使用value来调用元素的id吗?

<div class="tiles blue tile-group four-wide" id="tile_system" 
style="border-    color:#07caca;>
<div class="live-tile" data-speed="750" data-delay="3000" value="1" id="1">
    <a href="#"><div><img src="images/r1.gif" class="food-l" /></div></a>
    <div><img src="images/r2.gif" class="food-l"id="2"/></div>
</div>
<div class="live-tile" data-speed="750" data-delay="3000" value="2" id="2">
    <a href="#"><div><img src="images/r1.gif" class="food-l" id="1"/></div></a>
    <div><img src="images/r2.gif" class="food-l"id="2"/></div>
</div>
<div class="live-tile" data-speed="750" data-delay="3000" value="3" id="3">
        <div><img src="images/r3.gif" class="l-other"/></div>
    <div><img src="images/r3.gif" class="l-other"/></div>
</div>

<div class="live-tile" data-speed="750" data-delay="3000" value="4" id="4">
        <div><img src="images/r3.gif" class="l-other"/></div>
    <div><img src="images/r3.gif" class="l-other"/></div>
</div>
<div class="live-tile" data-speed="750" data-delay="3000" value="5" id="5">
    <a href="#"><div><img src="images/r1.gif" class="food-l" id="1"/></div></a>
    <div><img src="images/r2.gif" class="food-l"id="2"/></div>
</div>
<div …
Run Code Online (Sandbox Code Playgroud)

jquery

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