小编CPl*_*lus的帖子

我怎样才能永远重复过渡?

我的转换看起来像这样:

<?xml version="1.0" encoding="UTF-8"?>
<transition xmlns:android="http://schemas.android.com/apk/res/android" >

    <item android:drawable="@drawable/divider"/>
    <item android:drawable="@drawable/divider_active"/>

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

和代码看起来像这样:

View divider = v.findViewById(R.id.divider);
if (divider != null) {
  TransitionDrawable transition = (TransitionDrawable) divider.getBackground();
  transition.startTransition(2000);
}
Run Code Online (Sandbox Code Playgroud)

我的问题是,我不知道如何永远重复这种转变,所以我可以创造一个脉冲效果.

编辑:

为了清楚起见:在创建视图(listitem)时执行代码,因此循环不是解决方案.

android transition

14
推荐指数
2
解决办法
5598
查看次数

iPad上的iPhone应用程序在首次启动时没有响应触摸

如果我的iPhone应用程序(非通用)在我的iPad(第3代)上以横向模式启动,则在按下1x/2x按钮或更改方向之前,它不响应任何触摸.之后它正常工作.如果我在横向模式的iPhone 5上启动它,它就像一个魅力.

shouldAutorotateToInterfaceOrientation在每个View中都给出YES,所以我认为这不是问题所在.

第一个视图是标签栏视图.

iphone touch orientation ipad ios

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

由于无法加载XCode 6.3 - > Nib

我今天将我的XCode从6.2更新到6.3.我适应一切变化迅速,但是当我运行应用程序,我为每一个NIB错误,我尝试加载具有~ipad~iphone.(无法加载NIB)

没有那个设备修改器的笔尖像往常一样加载.如果我删除了~iphone或者~ipad,可以再次找到笔尖,但显然没有解决方案,因为它是一个通用应用程序.

每个其他文件类型也是如此,我尝试通过代码加载,例如故事板.

iphone xcode xib ios xcode6.3

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

Swift Dictionary Build错误

我试着将这个obj-c代码翻译成swift代码:

NSDictionary *settings = [NSDictionary dictionaryWithObjectsAndKeys:
                              [NSNumber numberWithFloat: 44100.0],                 AVSampleRateKey,
                              [NSNumber numberWithInt: kAudioFormatAppleLossless], AVFormatIDKey,
                              [NSNumber numberWithInt: 2],                         AVNumberOfChannelsKey,
                              [NSNumber numberWithInt: AVAudioQualityMax],         AVEncoderAudioQualityKey,
                              nil];
Run Code Online (Sandbox Code Playgroud)

//很快

    var settings = [NSNumber.numberWithFloat(Float(44100.0)): AVSampleRateKey,
            NSNumber.numberWithInt(Int32(kAudioFormatAppleLossless)): AVFormatIDKey,
            NSNumber.numberWithInt(2): AVNumberOfChannelsKey,
            NSNumber.numberWithInt(Int32(AVAudioQuality.Max)): AVEncoderAudioQualityKey];
Run Code Online (Sandbox Code Playgroud)

但我收到错误:Type()不符合协议'FloatLiteralConvertible'

有人知道如何纠正这个问题吗?谢谢

dictionary compiler-errors swift ios8

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