我刚刚开始Xamarin并尝试探索它.我制作了一个应用程序并尝试将其安装在Motorola ET1设备上,但我收到以下错误:
Detecting installed packages
Removing old runtime
Installing shared runtime
Removing old runtimes
Installing shared runtime
Installing platform framework
Removing previous version of application
Installing application on device
Synchronizing assemblies
Deployment failed because the FastDev assembly directory could not be created.
Deployment failed. FastDev directory creation failed.
Run Code Online (Sandbox Code Playgroud)
我在我的Galaxy S3上安装了相同的应用程序,它在那里工作得很好.我正在使用mac进行开发.我用谷歌搜索,发现禁用快速开发有帮助,但我找不到在Mac上的Xamarin Studio中禁用它的位置.为什么我不能在摩托罗拉ET1上安装此应用程序.我怎么能这样做?提前致谢.
我加载了一个长期处于休眠状态的 Xamarin.Android 项目,该项目上次在 MonoDevelop 中打开,当时它仍被称为 Mono for Android。每次我尝试构建项目、调试或发布时,它都会失败,并显示指向 R.java 的“错误:重复类”。
由于 R.java 只是为各种项目资源自动生成的文件,我尝试编辑文件名并让 Xamarin Studio 更新文件。这并没有解决构建错误。
类似的搜索会发现 axml 文件中 ID 命名不当的问题,但该项目中的所有 ID 似乎都满足 Android 要求(并且在我上次使用它生成项目的 APK时构建良好)。
我需要使用 c# 移动应用程序为我的 Xamarin 应用程序获取密码文本框。所以我在 main.xml 中创建了两个编辑文本。它们如下。
<EditText
android:id="@+id/edittext"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<requestFocus />
</EditText>
<EditText
android:password="true"
android:id="@+id/txtPassword"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textVisiblePassword" />
<requestFocus />
Run Code Online (Sandbox Code Playgroud)
在我的活动中,我使用这样的密码:
var editPassword = new EditText(this);
editPassword.Id = Resource.Id.txtPassword;
Run Code Online (Sandbox Code Playgroud)
但在密码文本框中,文本显示正常而不是 ************。
我在xamarin工作室社区版中创建了一个mac应用程序,在创建应用程序时我选择了目标版本10.11(mac/osx),但现在需要根据新要求更改为10.10.
请帮我看看如何在xamarin工作室中更改mac app的目标版本.
做了很多谷歌,但似乎对xamarin的帮助很少.
我正在使用Xamarin工作室并使用Xamarin.iOS开发iPad应用程序.
我在c#文件中针对布局约束插座设置了一个常量值.
_myRightSpaceConstraint.Constant = 50;
Run Code Online (Sandbox Code Playgroud)
为此常量设置动画,使其从以下位置开始:
_myRightSpaceConstraint.Constant = 300;
Run Code Online (Sandbox Code Playgroud)
至
_myRightSpaceConstraint.Constant = 50;
Run Code Online (Sandbox Code Playgroud)
或者,类似于上面但没有指定起始常量是什么(300),而是我只需要在xib文件中设置它并将其设置为50.
这是否可以在Xamarin中执行此操作,如果有,是否有任何代码示例可以帮助我?
UIView.BeginAnimations ("slideAnimation");
float _pt;
_pt = _myRightSpaceConstraint.Constant;
UIView.SetAnimationDuration (5);
UIView.SetAnimationCurve (UIViewAnimationCurve.EaseInOut);
UIView.SetAnimationDelegate (this);
UIView.SetAnimationDidStopSelector (
new Selector ("slideAnimationFinished:"));
_myRightSpaceConstraint.Constant = 50;
UIView.CommitAnimations ();
Run Code Online (Sandbox Code Playgroud)
这实际上将常量成功设置为50但没有动画.
我设法通过以下方式实现了我想要的目标:
_myRightSpaceConstraint.Constant = 150;
_myViewWithTheConstraint.SetNeedsUpdateConstraints ();
UIView.BeginAnimations ("slideAnimation");
UIView.SetAnimationDuration (1);
UIView.SetAnimationCurve (UIViewAnimationCurve.EaseInOut);
UIView.SetAnimationDelegate (this);
UIView.SetAnimationDidStopSelector (
new Selector ("slideAnimationFinished:"));
_myViewWithTheConstraint.LayoutIfNeeded ();
UIView.CommitAnimations ();
Run Code Online (Sandbox Code Playgroud)
以下是关键:
_myViewWithTheConstraint.LayoutIfNeeded ();
Run Code Online (Sandbox Code Playgroud) Xamarin错误:
"无法找到有效的Xcode安装.如果您的Xcode副本安装为非标准前缀,请在"SDK位置"下的Xamarin Studio首选项中指定位置.
在设置中找不到AppleSDK.
如何解决这个问题呢?
我是xna的新手,我正在制作一个RPG.当我尝试按项目构建时,我得到错误:
1)当前上下文中不存在名称"component":
if (component is DrawableGameComponent)
((DrawableGameComponent)component).Visible = true;
Run Code Online (Sandbox Code Playgroud)
2)当前上下文中不存在名称"content":
LoadContent(content);
Run Code Online (Sandbox Code Playgroud)
在"组件"的错误在发现GameScreen类和"内容"的错误在发现启动画面类.
为什么会发生这些错误?它们是什么意思?谢谢.
Game1.cs
namespace myRPG
{
/// <summary>
/// Default Project Template
/// </summary>
public class Game1 : Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
SpriteFont font;
//hold current state of the keyboard
KeyboardState keyboardState;
//hold previous state of the keyboard
KeyboardState oldKeyboardState;
//active screen will be set to either startScreen or actionScreen
GameScreen activeScreen;
StartScreen startScreen;
ActionScreen actionScreen;
CharScreen charScreen;
ClassScreen …Run Code Online (Sandbox Code Playgroud) 我是那种如何编写我的代码的人
if(...)
{
}
Run Code Online (Sandbox Code Playgroud)
但每次我这样做,Xamarin Studio会自动将我的代码更改为此
if(...){
}
Run Code Online (Sandbox Code Playgroud)
我该如何改变?
整个代码已完美编译,但出现错误的资源目录名称错误。
确切的错误是:
C:\ Users \ DELL \ Documents \ Projects \ PhoneWord \ PhoneWord \ aapt.exe:错误:无效的资源目录名称:“ res aboutresources.txt”。(PhoneWord)
请帮助我解决此问题。
我尝试在 Xamarin.Forms 中创建图表,但无法显示。我也想知道我要把这段代码放在哪里。它是在 .xaml 中还是在 .xaml.cs 中?我只是使用 Xamarin 的初学者,所以也许有人可以帮助我。
这是我要使用的代码。
using BarChart;
...
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
var data = new [] { 1f, 2f, 4f, 8f, 16f, 32f };
var chart = new BarChartView (this) {
ItemsSource = Array.ConvertAll (data, v => new BarModel { Value = v })
};
AddContentView (chart, new ViewGroup.LayoutParams (
ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent));
}
Run Code Online (Sandbox Code Playgroud) xamarin-studio ×10
xamarin ×7
c# ×4
xamarin.ios ×3
android ×2
xamarin.mac ×2
ios ×1
macos ×1
xna ×1