我要做的是单击一个按钮(在代码中创建)并让它调用一个不同的视图控制器,然后让它在新的视图控制器中运行一个函数.
我知道它可以在IB中相对容易地完成,但这不是一个选择.
我想要做的一个例子是,如果你有两个视图控制器,一个带有闪屏的房子.另一个视图控制器在房子上走过,你可以按照设定的顺序通过所有房间.启动画面会有每个房间的按钮,可以让你跳到步行的任何一点.
您好希望这是一个容易解决的问题.
我试图做的是在按钮动作上有一个选择器,它使用要播放的电影的fileName调用我的其他方法.如果我将文件名移回方法,它可以完美地工作.
我相信我磕磕绊绊的是将选择器添加到Button的正确方法.任何意见/建议或建议将不胜感激.
提前致谢.
//The Button
infobuttonTwo = [UIButton buttonWithType:UIButtonTypeRoundedRect];
infobuttonTwo.frame = CGRectMake(405, 204, 49, 58);
[infobuttonTwo addTarget:self
action:@selector(buttonInfo:) withObject:@"VTS_02_1"
forControlEvents:UIControlEventTouchUpInside];
//The Method It's calling
-(void)buttonInfo:(NSString *) fileName {
//The Error it's showing.
-[UIRoundedRectButton addTarget:action:withObject:forControlEvents:]: unrecognized selector sent to instance 0x660e9e0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIRoundedRectButton addTarget:action:withObject:forControlEvents:]: unrecognized selector sent to instance 0x660e9e0'
*** Call stack at first throw:
(
0 CoreFoundation 0x011bfbe9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x013145c2 objc_exception_throw + 47
2 CoreFoundation 0x011c16fb …Run Code Online (Sandbox Code Playgroud) 我意识到必须有大量的指南来做到这一点,但我找不到它......
我要做的是使用一个带有自定义图像的按钮,当你按下按钮时,图像会变为按钮的另一个"按下"版本.
我正在尝试使用通过代码(没有IB)在我的项目中创建的动态按钮,它们出现在我想要的地方和方式但他们不会触发他们的行为.
UIButton *button1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
button1.frame = CGRectMake(475, 302, 49, 58);
[button1 setTitle:@"1"
forState:(UIControlState)UIControlStateNormal];
[button1 addTarget:self
action:@selector(goToFirstTrailer)
forControlEvents:(UIControlEvents)UIControlEventTouchDown];
[myImageView addSubview:button1];
-(void)goToFirstTrailer {
[self startAnimator:@"OutsideToTrailer1_" forNumFrames:60];
}
Run Code Online (Sandbox Code Playgroud)
放置的imageView具有按钮和启用用户交互.
任何你可以流下的光都会非常感激.
任何人都可以指向我使用QuickLook打开(最好但不一定是pdf)文件而不使用UITableView的资源吗?
我确实有使用QuickLook的这个例子,但它使用了我需要远离的列表视图.
http://robsprogramknowledge.blogspot.com/2011/02/quick-look-for-ios_21.html
所以我试图做的是从我的程序启动资源管理器然后在资源管理器前弹出我的应用程序或者只是在我的应用程序后面启动资源管理器...
目前我有探险家开始然后我有动作将我的应用程序带到前面但探险家可能需要几秒钟才能开始,这会弄乱我的整个事件链.
这就是我目前正在做的事情:
Process process = new Process();
process.StartInfo.FileName = environmentVariable + "\\explorer.exe";
process.StartInfo.Arguments = !string.IsNullOrEmpty(this.uxMainFolder.Text) ? this.uxMainFolder.Text + "\\" + path2 : Path.Combine("R:\\Project", path2);
try
{
process.Start();
this.WindowState = FormWindowState.Minimized;
this.Show();
this.WindowState = FormWindowState.Normal;
}
finally
{
process.Dispose();
}
Run Code Online (Sandbox Code Playgroud)
你可以解决这个问题的任何亮点将非常感激.
编辑:我正在寻找一些事件,我可以在加载资源管理器后调用TopMost或我的最小化/显示/正常方法.
该程序生成一个项目目录,其中包含每个项目类型的所有必需文档,并在资源管理器中弹出该目录.
对于想要一次创建10个或20个项目的用户来说,这意味着生活质量的改变.
所以我有一个用于hololens的dotNet CoreCLR应用程序,我的理解是CoreCLR不支持标准套接字,建议的途径是使用StreamSocket.
这也是我的理解,CodedInputStream并且StreamSocket不兼容.
所以我一直在手动尝试解码预发送的大小,但它是一个varInt32,可以是2-4字节的任何东西.
这是我已经得到的,但可变大小问题给我带来了问题.
int bytenum = 0;
int num = 0;
while((bytes[bytenum] & 0x80) == 0x80){
bytenum++;
}
while(bytenum >= 0)
{
int tem = bytes[bytenum] & 0x7F;
num = num << 7;
num = num | tem;
bytenum--;
}
Run Code Online (Sandbox Code Playgroud)
有关如何修复此代码或我可能使用的替代方案的任何建议?
编辑:我也看过CodedInputStream.cs SlowReadRawVarint32()并尝试了这个没有成功......我认为DataReader正在做一些非标准的事情.
var dr = new DataReader(socket.InputStream);
await dr.LoadAsync(1);
int result = -1;
int tmp = dr.ReadByte();
if (tmp >= 128)
{
result = tmp & 0x7f;
await dr.LoadAsync(1);
if …Run Code Online (Sandbox Code Playgroud) 我有QuickLook(QLPreviewController)几乎按照我想要的方式工作,但由于图像特征,我不希望它旋转成纵向.我在"shouldAutoRotateToInterfaceOrientation"方法中配置它只返回yes用于横向旋转(参见下面的代码详细信息)但它仍然旋转到肖像.
注意: shouldAutoRotateToInterfaceOrientation是一个直接副本,在我的所有视图控制器中用于此项目,它在其他视图控制器中工作.
//
// documentViewer.m
//
#import "DocumentViewer.h"
@implementation DocumentViewer
@synthesize documents;
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft)
return YES;
else if (interfaceOrientation == UIInterfaceOrientationLandscapeRight)
return YES;
else
return NO;
}
- (void)viewDidLoad {
[super viewDidLoad];
}
//-(void)viewWillAppear:(BOOL)animated {
//
// self.userInteractionEnabled = YES;
//}
//Nessary for Enabling User Interaction
- (BOOL)canBecomeFirstResponder {
return YES;
}
-(void) createList:(NSString *) document {
documents = [[NSArray arrayWithObjects:document, nil] retain]; …Run Code Online (Sandbox Code Playgroud) 我对使用Unity 3d开发应用程序感兴趣,我有一个可以使用它的项目,但我需要一个速成课程.
当我开始为iOS开发时,我能够找到一个很棒的4天课程,我似乎找不到类似于Unity 3d的东西.
有人可以推荐类似的课程吗?
在它最简单的形式,我试图做的是填写一些预先存在的word文档的信息.我的代码做得很好......
它没有做的是修改它需要的格式,替换的文本需要变成黑色和粗体表格上的总计字段需要正确对齐.
如果有人能指出我在我的代码中如何做到这一点,那将非常感激.
这是我目前的代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Word = Microsoft.Office.Interop.Word;
namespace WordDocTesting
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void FindAndReplace(Word.Application WordApp,
object findText,
object replaceWithText)
{
object missing = Type.Missing;
object matchCase = true;
object matchWholeWord = true;
object matchWildCards = false;
object matchSoundLike = false;
object nmatchAllWordForms = false;
object forward = true;
object format = false; …Run Code Online (Sandbox Code Playgroud)