我的UITableViewCell出现在iPad上有问题.这个问题在iOS 7和现在之间出现了,但我不确定它何时开始.在iPod或iPhone上,我的手机看起来很好(纵向或横向),但在iPad上,显示配件非常宽.您可以在下图中看到一个示例.tablecell有一个绿色边框,contentview有一个棕色边框.内容视图比应该小得多.没有公开附件的台式电池看起来很好.
我正在使用Xamarin,我在代码中完全创建了这个UI.这是代码(我已经省略了在单元格内部放置ContentView的代码,因为它不相关:
protected void Draw()
{
Accessory = UITableViewCellAccessory.DisclosureIndicator;
Layer.BorderColor = UIColor.Green.CGColor;
Layer.BorderWidth = 1f;
Frame = new CGRect(0, 0, 320, 42);
ContentMode = UIViewContentMode.ScaleToFill;
AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;
ContentView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;
ContentView.MultipleTouchEnabled = true;
ContentView.ContentMode = UIViewContentMode.Center;
ContentView.ClipsToBounds = true;
ContentView.Layer.BorderColor = UIColor.Brown.CGColor;
ContentView.Layer.BorderWidth = 1f;
}
Run Code Online (Sandbox Code Playgroud)
我尝试通过覆盖单元格的LayoutSubviews方法来更改ContentView的大小.但是,ContentView现在和表格一样宽,但公开附件没有改变,现在在ContentView下面.
public override void LayoutSubviews()
{
base.LayoutSubviews();
//ContentView.Frame = new CGRect(0, 0, Frame.Size.Width, ContentView.Frame.Size.Height);
}
Run Code Online (Sandbox Code Playgroud)
同样,这在iPhone或iPod上根本不是问题.我不明白我应该做些什么来让iPad正常工作.
谢谢.扎克格林
编辑 - 10/21/2015 11:00 目前,我做了一个非常hacky的修改,正在修复这个问题,但我知道未来的iOS更新可能会打破这个,所以我更喜欢iOS更多的批准方式去做这个.
public override void LayoutSubviews()
{
base.LayoutSubviews();
//!! - …Run Code Online (Sandbox Code Playgroud) 我的应用程序在iOS模拟器上调试很好,当我构建ipa文件并将其部署到设备时,它运行正常.但是,如果我尝试在设备上调试(iPhone 9.3.1和iPad 9.3),应用程序会在启动时立即崩溃.我正在使用Visual Studio w/Xamarin.问题似乎是构建/配置/版本相关,因为它在模拟器和IPA文件版本上工作正常,但我无法弄清楚问题.
Visual Studio 2013 Update 5 Xamarin 4.0.3.214 Xamarin.iOS 9.6.1.8
有效的构建之间的项目配置:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<MtouchDebug>True</MtouchDebug>
<MtouchSdkVersion>8.1</MtouchSdkVersion>
<MtouchArch>i386</MtouchArch>
<MtouchOptimizePNGs>True</MtouchOptimizePNGs>
<MtouchUseSGen>True</MtouchUseSGen>
<MtouchUseRefCounting>True</MtouchUseRefCounting>
<MtouchI18n>
</MtouchI18n>
<MtouchProfiling>True</MtouchProfiling>
<MtouchLink>None</MtouchLink>
<CodesignKey>iPhone Developer</CodesignKey>
<CodesignProvision>
</CodesignProvision>
<CodesignExtraArgs>
</CodesignExtraArgs>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchSdkVersion>8.1</MtouchSdkVersion>
<MtouchArch>ARMv7</MtouchArch>
<MtouchOptimizePNGs>True</MtouchOptimizePNGs>
<MtouchI18n>
</MtouchI18n>
<MtouchUseSGen>True</MtouchUseSGen>
<MtouchDebug>True</MtouchDebug>
<MtouchProfiling>True</MtouchProfiling>
<SignAssembly>true</SignAssembly>
<CodesignProvision>
</CodesignProvision>
<CodesignExtraArgs>
</CodesignExtraArgs>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == …Run Code Online (Sandbox Code Playgroud) 自从将Windows 10更新到1803以来,我已经开始接收此错误,只要我运行一个EF查询,该查询连接一个带有标量参数的表值函数.
消息:传入的表格数据流(TDS)远程过程调用(RPC)协议流不正确.参数2(""):数据类型0x00未知.
堆栈跟踪:位于System.Threading.Tasks.Task.Execute()的System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()中的System.Data.SqlClient.SqlCommand.<> c.b__180_0(Task1结果).从抛出异常的先前位置开始的堆栈跟踪结束---在System.Data.Entity.Core.EntityClient的System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)的System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()处.Internal.EntityCommandDefinition.d__c.MoveNext()
我在.NET 4.6框架项目中使用Entity Framework v6.2.我验证了相同的代码在使用Windows 10 1709的另一台计算机上执行没有问题.我将计算机更新到Windows 10 1803而没有其他更改,我开始收到上述错误.导致错误的代码:
var query = from fs in db.ViewWithInformation
join e in db.GetEventsForPerson(personnelId) on fs.Event_Id equals e.Event_Id
where !fs.Is_Deleted
select fs;
return await query.ToArrayAsync();
Run Code Online (Sandbox Code Playgroud)
如果我针对db.GetEventsForPerson删除连接,则查询将运行.上面的EF查询生成的SQL在SSMS中运行良好.
编辑5/15/2018:我已经确认这是由.NET Framework 4.7.2特别引起的.我在Windows 10 1709计算机上手动安装了.NET 4.7.2,错误再次启动.
我在Xamarin iOS项目中使用SQLite.NET Async(http://www.nuget.org/packages/SQLite.Net.Async-PCL/),但是我在使用表谓词查询时遇到了问题.
任何时候我使用下面的Get方法,这很简单,我收到一个异常,表达式无法编译,System.NotSupportedException:无法编译:参数.
但是,如果我使用低级查询,与GetQuery方法一样,它可以正常工作.在我的表的定义或阻止sqlite.net编译表达式的方法中,我做错了吗?
public interface IDataModel
{
[PrimaryKey, AutoIncrement]
int Id { get; set; }
}
public class BaseDataModel : IDataModel
{
[PrimaryKey]
public virtual int Id { get; set; }
}
[Table("Event")]
public class EventDataModel : BaseDataModel
{
public string Name { get; set; }
public int OrganizationId { get; set; }
public DateTime StartDate { get; set; }
public DateTime? EndDate { get; set; }
public bool Active { get; set; }
}
public …Run Code Online (Sandbox Code Playgroud) 我有一个int?查看在客户端验证的模型属性,就像它是必需的一样.也就是说,如果我将该字段留空,则不会提交.字符串属性不会发生同样的情况.
为我的编辑器呈现的HTML是:
<input type="text" value="" name="StatusIdSearch" id="StatusIdSearch" data-val-number="The field Status must be a number." data-val="true" class="text-box single-line">
Run Code Online (Sandbox Code Playgroud)
我认为这data-val-number会导致错误,因为没有什么不是数字,但我无法确定原因.
有任何想法吗?
编辑
视图模型:
public class CompromissoSearchModel
{
// other properties removed for the sake of clarity
[Display(Name = "Status")]
[EnumDataType(typeof(StatusCompromisso))]
public int? StatusIdSearch { get; set; }
// other properties removed for the sake of clarity
}
Run Code Online (Sandbox Code Playgroud) 当我尝试在BLOB字段上运行dbms_lob.substr函数时,我收到以下错误:
ORA-06502:PL/SQL:数值或值错误:原始变量长度太长
ORA-06512:第1行
我的查询:
select dbms_lob.substr(my_report, 10000, 1)
from my_table where my_table.report_id = :myid
Run Code Online (Sandbox Code Playgroud)
根据dbms_lob.substr文档,我应该能够在第二个参数中使用一个值达32767,并且报告的大小超过200,000字节,因此它在该范围内.
在使用数字后,我发现我可以在量参数(第二个参数)中使用的subs值为substr函数.
有谁知道为什么?
环境:
Windows Server 2008 R2
IIS 7.5
.NET 4.0, Integrated Application Pool
Oracle Client 11.2.0.2.0
ODP.net 11.2.0.2.3
Run Code Online (Sandbox Code Playgroud)
我有一个使用ODP.net连接到我们的Oracle数据库的网站,在"完全信任"下,该应用程序运行完美.但是,当我将应用程序更改为使用"中等信任"时,我开始从应用程序获取不一致的NullReferenceExceptions.大多数时候代码都有效,但每10个请求左右我就得到NullReferenceException.查看事件日志后,我发现NullRefernceException通常对应于w3wp.exe崩溃.
Faulting application name: w3wp.exe, version: 7.5.7601.17514, time stamp: 0x4ce7afa2
Faulting module name: OraOps11w.dll, version: 2.112.2.0, time stamp: 0x4cea1904
Exception code: 0xc0000005
Fault offset: 0x0000000000024d56
Faulting process id: 0x3ba4
Faulting application start time: 0x01ccdf556d68384a
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path: C:\Oracle64\product\11.2.0\client\bin\OraOps11w.dll1
Run Code Online (Sandbox Code Playgroud)
显然问题是ODP.NET,但为什么它会在"中等信任"中崩溃w3wp.exe.因此,为了确保我的代码中没有出错,我编写了最简单的ASP.NET Web应用程序:
protected void Page_Load(object sender, EventArgs e) {
using(OracleConnection conn = new OracleConnection(GetMyConnectionString())){
using (OracleCommand cmd = new OracleCommand("select localtimestamp …Run Code Online (Sandbox Code Playgroud) 我的网站有一些客户适用于阻止IE中字体下载的组织,因此我需要为FontAwesome创建后备选项.我试图使用Web字体加载器来检测FontAwesome是否正确加载,但Web字体加载器总是报告FontAwesome无法加载,即使我可以看到FontAwesome图标已加载.我测试了IE 9/10/11.
您可以在https://vnext.radresponder.net上查看此操作.您将看到在Firefox和Chrome中,FontAwesome已正确加载并标记为活动状态; 但是,在IE中加载字体,但随后Web字体加载器触发加载回调失败并将非活动类附加到HTML标记.我有一些特殊的CSS来加载一些后备字符来替换随后加载的FontAwesome图标.
从Web字体加载器GitHub页面,我没有看到与IE列出的任何不兼容性,所以我认为这应该工作.
这是我的WebFont.load语句.
WebFont.load({
custom: {
families: ['FontAwesome'],
urls: ['/local/address/for/fontawesome.css'],
testStrings: {
'FontAwesome': '\uf00c\uf000'
}
},
loading: function () {
console.log("loading");
},
fontloading: function (fontFamily, fontDescription) {
console.log('fontloading: ' + fontFamily);
},
fontactive: function (fontFamily, fontDescription) {
console.log('fontActive: ' + fontFamily);
},
fontinactive: function (fontFamily, fontDescription) {
console.log('fontInActive: ' + fontFamily);
},
active: function () {
console.log("active: loaded all web fonts");
},
inactive: function () {
console.log("inactive: did not load all web fonts");
}
}); …Run Code Online (Sandbox Code Playgroud)自安装最新版本的ODAC 11.2.0.2.1以来,我遇到了一个奇怪的问题.我安装了32位和64位版本,因为我为这两种架构开发了应用程序.我的电脑是Win 7 64位.
自从安装ODAC并引用新的64位版本的ODP.NET以来,我在Visual Studio 2010中的一个Web应用程序项目在标记视图中查看时,会对所有aspx页面和主页面发出以下警告.
ASP.NET runtime error: Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Run Code Online (Sandbox Code Playgroud)
警告仅限于标记视图.Web应用程序构建并运行良好.我尝试清理VS临时ASP.NET文件,但这并没有解决问题.我在整个应用程序中删除了对Oracle.DataAccess的所有引用,然后重新读取它们以确保所有引用都是正确的.Web应用程序编译为"任何CPU",但它使用64位Oracle.DataAccess.我创建了一个新项目,并引用了相同的项目和dll,但我没有得到警告,因此它似乎特定于此项目文件.
任何想法为什么我会在Markup View中收到警告?
我需要从MVC3上传多个文件.但我没有得到服务器上的变量.这是我的代码.
@using (Html.BeginForm("Index","Register", FormMethod.Post, new { enctype = "multipart/form-data" })) {
@Html.ValidationSummary(true)
<table>
<tr>
<td class="label">@Resources.Global.exemploFotos</td>
<td><input type="file" name="file" class="multi" accept="gif|jpg" maxlength="3" /></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="@Resources.Global.enviar" /></td>
</tr>
</table>
}
Run Code Online (Sandbox Code Playgroud)
控制器:
[HttpPost] public ActionResult Index(IEnumerable<HttpPostedFileBase> fileUpload, FormCollection collection)
{
return View();
}
Run Code Online (Sandbox Code Playgroud)
但是fileUpload == Null;
我有一个foreach循环
var axsEntities = GetAxsEntitiesForInvoicing(adapter)
.GroupBy(x => x.AccountUsingAccountIdToAccountId);
foreach(var gbAccount in axsEntities)
{
int i = gbAccount.count();
}
Run Code Online (Sandbox Code Playgroud)
现在,当我在没有循环的情况下运行它时运行正常,但是使用循环它会占用太多内存,在这种情况下为3千兆字节.这可能是什么原因?
谢谢
我的看法
<div id="ValidationSummary">
@Html.Partial("ValidationSummary")
</div>
@using (Ajax.BeginForm("Index", //<-- Action name
"JobDetails", //<-- Controller name
new AjaxOptions { HttpMethod = "Post", UpdateTargetId = "ValidationSummary" }))
{
}
Run Code Online (Sandbox Code Playgroud)
我想要ValidationSummary来替换.但它将我的URL更改为JobDetails
我希望在ASP.NET窗体中获得BackColor of Label并使用此值更改此标签的颜色是可能的吗?
<asp:Label ID="Label2" runat="server" Text="Label" BackColor='<%# System.Drawing.Color.FromName(Eval(Container.DataItem,"BgColor").ToString())%>'></asp:Label>
Run Code Online (Sandbox Code Playgroud)
谢谢.
c# ×6
asp.net ×3
xamarin ×3
asp.net-mvc ×2
ios ×2
odp.net ×2
xamarin.ios ×2
.net-4.5 ×1
.net-4.7.2 ×1
c#-4.0 ×1
css ×1
font-awesome ×1
foreach ×1
loops ×1
memory ×1
mvvmcross ×1
ora-06502 ×1
oracle ×1
oracle11g ×1
razor ×1
sql-server ×1
sqlclient ×1
sqlite.net ×1
uitableview ×1
vb.net ×1
webfonts ×1