我正在尝试将Phonegap Barcode扫描程序插件添加到我的Phonegap应用程序中.我主要是为windows phone 8开发,但我也希望以ios和android平台为目标.我设法正确添加插件,但是当我开始扫描时,我的Windows手机无法识别任何条形码.它只显示带有焦点按钮和绿色方块的视频屏幕.
这是我的扫描代码:
function Scan() {
window.plugins.barcodeScanner.scan(function (result) {
barcode = result;
alert(barcode.text);
}, function (error) {
alert("Scanning failed: " + error);
});
};
Run Code Online (Sandbox Code Playgroud)
在deviceready事件上调用此函数.
难道我做错了什么?或者我错过了插件中的某些内容?我读到android和ios需要设置执行此插件的权限.我是否需要获得许可才能在Windows手机中进行扫描?
更新:
我似乎可以扫描QR码而不是常规码(SCC码).有人对此有所了解吗?
我正在使用最新的Xcodeie 6.3和我的设备(iPad Mini)iOS ver 8.3(12F69).我无法使用此设备测试我的应用程序,因为它显示了不合格的设备.请参阅xcode附带的屏幕截图.
我不确定为什么会这样,使用最新的Xcode


我想知道是否有人可以建议我如何创建模拟器构建Apple Watch.我正在按照[创建模拟器构建的链接]中的步骤(https://developers.facebook.com/docs/iOS/creating-iOS -simulator-build-for-review)
但是如果我们使用像xcodebuild -showsdks
它只显示的命令iPhone Simulator.
虽然我已经使用这些命令为具有目标的项目创建了模拟器构建Apple Watch,但它不在手表模拟器上运行.
因此,如果有人可以建议如何创建Simulator构建,将会有所帮助Apple Watch.
嗨,我正在开发一个Windows Phone应用程序.
我想在我的应用程序中实现错误记录.我想以更好的方式处理错误日志.
如何记录错误信息(这样有助于开发人员纠正错误)
是否有任何第三方工具/免费库用于在metro应用程序中进行错误记录.
有哪些错误记录可用的替代方案?
错误记录的最佳实践是什么?
请帮帮我.
你的回答对我很有帮助.
提前致谢.
windows-phone-7 windows-phone-7.1 windows-phone-7.1.1 windows-phone-8
这是我用于在XAML中绑定图像的代码
<Border toolkit:TiltEffect.IsTiltEnabled="true" Height="350" Width="400" Grid.ColumnSpan="3">
<Grid Height="350" Width="400" Margin="70,0,70,0" x:Name="Container1">
<Grid.Background>
<ImageBrush ImageSource="{Binding ImageCollection[0]}" Stretch="Uniform" AlignmentX="Left" AlignmentY="Center"/>
</Grid.Background>
<i:Interaction.Triggers>
<i:EventTrigger EventName="Tap">
<i:InvokeCommandAction Command="{Binding ImageTapCommand}" CommandParameter="CONTAINER0"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Grid>
</Border>
Run Code Online (Sandbox Code Playgroud)
同样我使用4边框显示我最近的图像.
在我的ViewModel中,我使用以下方法从隔离存储中读取图像.
public Stream GetFileStream(string filename, ImageLocation location)
{
try
{
lock (SyncLock)
{
if (location == ImageLocation.RecentImage)
{
filename = Constants.IsoRecentImage + @"\" + filename;
}
using (var iSf = IsolatedStorageFile.GetUserStoreForApplication())
{
if (!iSf.FileExists(filename)) return null;
var fs = iSf.OpenFile(filename, FileMode.Open, FileAccess.Read);
return fs;
}
}
}
catch (Exception …Run Code Online (Sandbox Code Playgroud) 我是Windows手机开发的新手.
我在列表框中显示数据.对于列表框中的所有行,背景颜色相同.但我想为备用行添加两种不同的颜色来列出框项目.
下面是列表视图的代码.
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="0,10,0,0" Background="White">
<ListBox Margin="6,6,-6,6" Name="itemslb" SelectionChanged="itemList_SelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid x:Name="listItem">
<Grid.RowDefinitions>
<RowDefinition Height="100"/>
<RowDefinition Height="10"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal" Height="100" Margin="0,10,0,0">
<StackPanel Width="85" Height="100" >
<StackPanel.Background>
<ImageBrush x:Name="defImage" ImageSource="/DailyFeeds;component/Images/default.png" Stretch="None"></ImageBrush>
</StackPanel.Background>
<Image Source="{Binding ImageUrl}" VerticalAlignment="Top" Height="90" Width="85" Margin="0,0,10,0" Stretch="Fill" />
</StackPanel>
<StackPanel Width="370">
<TextBlock Text="{Binding Title}" Foreground="SlateBlue" FontSize="25" TextWrapping="Wrap" />
<TextBlock Text="{Binding Date}" Foreground="#FFC8AB14" FontSize="20"/>
</StackPanel>
</StackPanel>
<Image x:Name="line" Grid.Row="1" Width="460" HorizontalAlignment="Center" Margin="0,5,0,0" Source="/DailyFeeds;component/Images/separator.png" />
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
Run Code Online (Sandbox Code Playgroud)
我们怎么做到这一点.
谢谢
我正在开发的应用程序的Windows Phone 8的,以及我在注册的DreamSpark微软学生开发者账号,所以我的问题是我可以提交应用程序用于商业目的(赚钱)使用此帐户.所以,请为我提供足够和有用的知识.在此先感谢,任何建议将不胜感激.
windows-phone-7 windows-store windows-phone-8 windows-store-apps dreamspark
我有一个IBAction连接到一个按钮,我想知道是否有任何方法来运行该功能,即使没有按下按钮.这就是我试过的......
注意:我在这个项目中使用swift.
//I get an error when I type this code?
self.buttonPressed()
@IBAction func buttonPressed(sender: AnyObject) {
print("Called Action")
}
Run Code Online (Sandbox Code Playgroud) 在这里,我必须为User和UserType建模.如果我更改usertype然后用户属于特定的usertype将在下拉列表中列出.这是我的代码.
*.html的
<div class="control-group string optional payslip_user_type_id">
<label class="string optional control-label" for="payslip_user_type_id">Employee Type</label>
<div class="controls">
<%= f.collection_select :user_type_id, UserType.all, "id", "name", prompt: '--select--' %>
</div>
</div>
<div class="control-group string optional payslip_user_id">
<label class="string optional control-label" for="payslip_user_id">Employee Name</label>
<div class="controls">
<%= f.collection_select :user_id, @users, "id", "name", prompt: '--select--' %>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
jquery文件是
$("#payslip_user_type_id").change(function(){
var url = '/payslips/new?user_type_id=' + $(this).val() + ''
$.ajax({
url: url,
dataType: 'script',
type: 'GET',
success: function(data){ $("#payslip_user_id").html(data); }
});
})
Run Code Online (Sandbox Code Playgroud)
控制器代码是
if params[:user_type_id].present?
@users = UserType.find(params[:user_type_id]).users
respond_to …Run Code Online (Sandbox Code Playgroud) 这是我尝试更新count表中的字段的函数。但它没有更新该值。查询 100% 正常,因为我已经在外部数据库软件中尝试过了。可能是我使用了错误的函数来执行我的语句?
func updateLocalCount(var localCounter: Int)
{
let contactDB = FMDatabase(path: databasePath as String)
if contactDB.open()
{
let querySQL = "UPDATE Darood SET count='\(localCounter)' WHERE title='\(myTitle)'"
let results:FMResultSet? = contactDB.executeQuery(querySQL,
withArgumentsInArray: nil)
print(querySQL)
contactDB.close()
print("local count \(localCounter)")
}
else
{
print("Error: \(contactDB.lastErrorMessage())")
}
}
Run Code Online (Sandbox Code Playgroud) 我如何基于iOS版本定义实例变量,例如CNContactStore,自从已弃用该实例变量以来iOS9.0,就不
可用了ABAddressBook,9.0但是我想根据iOS版本创建两个变量。我的方法是
if #available(iOS 9.0, *) {
var addressBookRef: ABAddressBook? = nil
} else {
var contactStore : CNContactStore? = nil
}
Run Code Online (Sandbox Code Playgroud)
如果我在方法主体中执行此操作,则工作正常,但我希望对其进行全局定义,并且可以在整个类中进行访问,但如果这样做就给我错误
@available(iOS 9.0, *)
var contactStore : CNContactStore? = nil
Run Code Online (Sandbox Code Playgroud)
需要一些建议。我该如何实现。我不知道是否发布@available(iOS 9.0, *),它会导致我的应用在iOS 8.x或更低版本上崩溃吗?
使用ChromeCast开发和应用程序使用Styled Media Receiver播放音频文件.一切都工作正常,除了音频播放器视图在一段时间后重新定位.我希望视图应始终位于初始位置,即左下角,如附图所示.

另一件事是当我们停止播放音频(暂停状态)时,进度条会全屏显示.如果我可以一直在整个屏幕上显示进度条会更好.
请提出您的宝贵意见.谢谢