小编Sag*_*ari的帖子

如何隐藏键盘 - UITextView iPhone - 通过返回键

在UITextView中,当我们点击它时,

出现键盘,

但是当用户按下返回键时,(通常在textView中创建一个新行)

键盘应该下降.

怎么样?

iphone uitextview iphone-softkeyboard

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

睡眠功能的替代方案

我在我的申请中实施了以下内容.

for(i=0;!stopThroughButtons && i<totalMovements;i++){
        [NSThread detachNewThreadSelector:@selector(moveNeedle) toTarget:self withObject:nil];
        sleep(0.3);
    }
Run Code Online (Sandbox Code Playgroud)

sleep是一个带有unsigned int类型参数的函数.

睡眠方法使用秒钟睡眠.

我想以毫秒为单位给出睡眠时间.

有哪种最佳替代品?

iphone sleep

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

更换sprite中的图像 - iPhone的cocos2d游戏开发

我想改变精灵图像.

比如说:

mainSprite=[Sprite spriteWithFile:@"redFile.png"];
[self addChild:mainSprite];
Run Code Online (Sandbox Code Playgroud)

这里,Sprite已添加到图层中.我有mainSprite(指针)可以访问它.

如果我改变

[mainSprite setOpacity:150];
Run Code Online (Sandbox Code Playgroud)

它完美地运作.但在这里我想改变精灵图像而不是不透明度.

但我不知道怎么做.

xcode sprite cocos2d-iphone

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

html - 选择范围 - 获取范围+起始节点+结束节点+距离

从我之前选择特定html文本的问题,我已经通过这个链接来了解html字符串中的范围.

用于在html页面上选择特定文本.我们需要遵循这些步骤.

假设HTML:

<h4 id="entry1196"><a
    href="http://radar.oreilly.com/archives/2007/03/call_for_a_blog_1.html"
    class="external">Call for a Blogger's Code of Conduct</a></h4>

<p>Tim O'Reilly calls for a Blogger Code of Conduct. His proposals are:</p>

<ol>
    <li>Take responsibility not just for your own words, but for the
        comments you allow on your blog.</li>
    <li>Label your tolerance level for abusive comments.</li>
    <li>Consider eliminating anonymous comments.</li>
</ol>
Run Code Online (Sandbox Code Playgroud)

java脚本按范围进行选择

var range = document.createRange();  // create range
var startPar = [the p node];         // starting parameter 
var endLi = [the …
Run Code Online (Sandbox Code Playgroud)

html javascript select dhtml range

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

Swift iOS 将字符串“Hello”屏蔽为“Hxxxo”

extension String {
    var masked: String {
        // some logic which I have to write to mask string.

        // I tried following and just shows x ???
        // replacingOccurrences(
        //      of: ".(.+).", 
        //      with: "x", 
        //      options: .regularExpression, 
        //      range: nil
        //)
    }
}
let helloWorld = "Hello World"
print("Masked string is - \(helloWorld.masked)")
Run Code Online (Sandbox Code Playgroud)

预期输出是 - “Hxxxxxxxxxd”

string ios swift

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

何时使用#import&when @class - iPhone

我已经创建了一个名为"Category"的类

在我看到的一些在线示例中 - 他们实现了#import"Category.h"

在某些示例中 - 在@interface新类之前预先声明为@category的类

所以我很困惑=>何时使用#import&=>何时使用@class?

iphone objective-c

8
推荐指数
0
解决办法
1516
查看次数

如何修复 fastlane-plugin-firebase_app_distribution 未定义

我正在尝试在本地系统上为 firebase 应用程序分发设置 CI-CD。

fastlane-plugin-firebase_app_distribution 找不到插件。

Error loading plugin 'fastlane-plugin-firebase_app_distribution': cannot load such file -- fastlane/plugin/firebase_app_distribution
+-------------------------------------------+-----------+------------------+
|                               Used plugins                               |
+-------------------------------------------+-----------+------------------+
| Plugin                                    | Version   | Action           |
+-------------------------------------------+-----------+------------------+
| fastlane-plugin-firebase_app_distribution | undefined | No actions found |
+-------------------------------------------+-----------+------------------+
Run Code Online (Sandbox Code Playgroud)

我该怎么办?

ios firebase fastlane firebase-cli

8
推荐指数
3
解决办法
4326
查看次数

解析存储在iPhone应用程序的Documents目录中的XML文件

NSXMLParser有三种类型的init.

- > init

- > initWith Data

- > init的initWithContents


=>但是我的xml文件存储在Application的Document目录中,所以如何解析存储在"Doc Dir"中的文件

提前致谢.

iphone objective-c nsxmlparser

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

iPad中UIModalPresentationFormSheet的确切大小是多少?

我正在使用以下代码来显示屏幕/视图控制器.

SearchParams *nxt=[[SearchParams alloc] initWithNibName:@"SearchParams" bundle:nil];

UINavigationController *nvc=[[UINavigationController alloc] initWithRootViewController:nxt];

nvc.modalPresentationStyle=UIModalPresentationFormSheet;

[self.preLCtr.preCinescape_iPadViewController presentModalViewController:nvc animated:YES];
Run Code Online (Sandbox Code Playgroud)

我不确定PesentationSheet的大小.我试图截取屏幕并采取尺寸/尺寸.但它不是确切的解决方案.

问题:iPad中Present-Modal-Sheet的确切大小是多少?

size xcode interface-builder ipad ios

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

ktor android本地http服务器抛出错误

我做了什么?

  1. 添加了依赖项下build.gradle
implementation "io.ktor:ktor:1.3.2"
implementation "io.ktor:ktor-server-netty:1.3.2"
implementation "io.ktor:ktor-gson:1.3.2"
Run Code Online (Sandbox Code Playgroud)
  1. AndroidMenifest.xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.BLUETOOTH" />
Run Code Online (Sandbox Code Playgroud)
  1. MainActivity.kt
class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        embeddedServer(Netty, 9000) {
            install(ContentNegotiation) {
                gson {}
            }
            routing {
                get("/") {
                    call.respond(mapOf("message" to "Hello world"))
                }
            }
        }.start(wait = true)
    }
}
Run Code Online (Sandbox Code Playgroud)

什么地方出了错?

运行应用程序后,我收到以下错误并且 Android 本地服务器未启动。

No implementation found for int io.netty.channel.kqueue.Native.sizeofKEvent() 
(tried Java_io_netty_channel_kqueue_Native_sizeofKEvent 
and Java_io_netty_channel_kqueue_Native_sizeofKEvent__)

No implementation found for int io.netty.channel.epoll.Native.offsetofEpollData() 
(tried Java_io_netty_channel_epoll_Native_offsetofEpollData 
and Java_io_netty_channel_epoll_Native_offsetofEpollData__)
Run Code Online (Sandbox Code Playgroud)

android localhost httpserver kotlin ktor

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