小编roc*_*mer的帖子

android studio designer preview:如何包含设备框架?

对于"如何移除设备框架"的相反问题似乎有大量答案,该问题指示用户单击预览内的"设置"按钮以取消选中"包括设备框架(如果可用)".但是对于我在Mac和2.2.1之前使用2.2.2,这样一个带有该选项的按钮永远不可用.开箱即用(dmg)Android Studio Designer始终只显示没有任何设备框架的视口.

对Designer设置的这种解释表明该选项仅在选择"包含设备框架"选项时才可用,但对我来说这是一个鸡和鸡蛋问题.我正在使用已选择"启用设备帧"的默认Nexus 6P AVD.我看到的唯一设置按钮(位于预览窗格之外,不在内部)仅显示这些选项.

我看到的唯一设置按钮位于预览窗格之外,而不是在内部

它只显示这些选项

如何显示设备框架?谢谢

android designer preview android-studio

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

xcode中的ipad故事板无法拖动按钮

我正在运行xcode 4.5.2为iphone和ipad("通用"应用程序)编写iOS应用程序.

我可以使用iphone故事板将按钮,标签等拖放到它上面.实际上我在iphone端有功能代码.

但是,从一开始,我就无法将任何内容拖放到ipad故事板上.当我尝试这样做时,按钮,标签等只是"反弹".

有没有办法重置iPad故事板,以便我可以得到一个干净的开始?可能是我错误地(这是我的第一个iOS应用程序)将视图或视图控制器拖到ipad故事板上.我尝试删除它,但整个ipad故事板在此之后消失了.

这可能是非常简单的事情,但我对此非常陌生.谢谢.

xcode drag-and-drop storyboard

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

git vs xcode快照

我正在学习通过itunesU视频在iOS中编程,并且一直在使用xcode.我在xcode中找到了创建快照的功能,到目前为止,我已经用它来拍摄每个主要里程碑的项目快照.

然后我来到关于使用git进行版本控制的章节,并按照他们的指示进入"git init",它给出了这个响应"在/Users/username/Developer/Calculator/Calculator/.git/中重新初始化了现有的Git存储库"而不是"在/Users /...etc中初始化的空git存储库",这让我认为快照已经完成了.

我的问题是:在运行"git init"之前,我是否以任何方式搞砸了我在xcode中创建的快照?谢谢.

git xcode snapshot

7
推荐指数
2
解决办法
1733
查看次数

android gridlayout未显示在模拟器API 22中

我有一个应用程序在运行 API 23 的实际设备 Nexus 6P 和运行 API 24 的模拟 6P、5 和 4 上完全按需要运行,但GridLayout在运行 API 22 的模拟 Nexus 5 和 4 上显示出奇怪的行为。

该应用程序只有一个活动,其中包含多个RelativeLayout以编程方式设置的.VISIBLE& .INVISIBLE。在一个这样的RelativeLayout我有 2 GridLayouts 如下。模拟 API 22 时,底部GridLayout不显示,但顶部始终显示,与 API 22、23 或 24GridLayout无关。底部仅在我将模拟器设置更改为 API 24 时显示(未尝试 23)。为什么会这样?我认为我没有使用任何GridLayout需要 API 23 或更高版本的东西。此问题意味着我无法在运行 API 22 或 21 的 Nexus 5 上安装此应用程序。感谢您的任何建议。

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/gameOperations"
    android:visibility="invisible">

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/launchDisplay"
        android:gravity="center_horizontal">

        <TextView
            android:text="@string/app_name"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" …
Run Code Online (Sandbox Code Playgroud)

android android-emulator android-gridlayout android-relativelayout android-api-levels

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

如何在Swift中断后恢复音频?

我在这里遵循指示,我已经把这个测试项目放在一起来处理音频播放的中断.具体来说,我正在使用默认iphone时钟应用程序中的警报作为中断.似乎中断处理程序被调用但没有越过该let = interruptionType行,因为" 错误类型 "出现两次.

import UIKit
import AVFoundation

class ViewController: UIViewController {

    var player = AVAudioPlayer()

    let audioPath = NSBundle.mainBundle().pathForResource("rachmaninov-romance-sixhands-alianello", ofType: "mp3")!

    func handleInterruption(notification: NSNotification) {

        guard let interruptionType = notification.userInfo?[AVAudioSessionInterruptionTypeKey] as? AVAudioSessionInterruptionType else { print("wrong type"); return }

        switch interruptionType {

        case .Began:
            print("began")
            // player is paused and session is inactive. need to update UI)
            player.pause()
            print("audio paused")

        default:
            print("ended")
            /**/
            if let option = notification.userInfo?[AVAudioSessionInterruptionOptionKey] as? AVAudioSessionInterruptionOptions where option == .ShouldResume { …
Run Code Online (Sandbox Code Playgroud)

audio resume interruption swift

4
推荐指数
2
解决办法
6752
查看次数

如何指定python版本来运行脚本?

我现在正在使用预装python 2.7.5的mac机学习python。但是我还安装了最新的3.4。

我知道如何选择在命令行模式下使用的解释器,即python vs python 3将调出相应的解释器。

但是,如果我只写了一个带有此标头的python脚本“#!/ usr / bin / python”并使其可执行,那么如何强制它使用3.4而不是2.7.5?

就目前而言,print sys.version表示:

2.7.5(默认,2013年8月25日,00:04:04)[与GCC 4.2.1兼容的Apple LLVM 5.0(clang-500.0.68)]

python

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