我在Bootstrap中遇到了imgAreaSelect插件的问题.我在初始化imgAreaSelect时设置父级以防止滚动移动区域:
thumb.imgAreaSelect({
handles: true,
aspectRatio: '1:1',
fadeSpeed: 300,
parent: "#thumbBox"
})
Run Code Online (Sandbox Code Playgroud)
这是我的HTML:
<div class="modal-body">
<div class="row">
<div class="col-xs-12" style="font-weight:bold;">
Upload your picture and crop it.
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div id="thumbBox">
<img id="thumb" class="img-responsive" />
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
当我试图选择一个区域时,ImgAreaSelect选择图片外的区域但是点(我的意思是x1,x2等)正是我想要的(功能正常但在界面中有问题).在较小的设备中,ImgAreaSelect接口是尼特,但在某些情况下它会搞砸!我曾经搜索过很多,但我找不到任何有用的东西.我该如何解决这个问题?
更新: 我解决了这个我自己...请参阅此链接: github
我们必须从代码中删除这些行:
/* Also check if any of the ancestor elements has fixed position */
if ($p.css('position') == 'fixed')
position = 'fixed';
Run Code Online (Sandbox Code Playgroud)
我们必须相对于我们自己初始化的父框(父级:"#thumbBox").
谁能告诉我一个简单的例子,用json格式从android发布数据到asp mvc web服务器?我使用它来从asp.net mvc获取数据到json格式的android:
new Thread() {
public void run() {
try{
JsonNode userData = null;
ObjectMapper mapper = new ObjectMapper();
HttpResponse res;
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpPost post = new HttpPost(URI.create("http://mylink.com/test/api"));
res = httpclient.execute(post);
userData = mapper.readValue(res.getEntity().getContent(), JsonNode.class);
name= (String)userData.get("name").getTextValue();
}catch(Exception e){
Log.e("activity","dead",e);
}
}
}.start();
editStatus.setText(name);
Run Code Online (Sandbox Code Playgroud)
在asp.net中:
[HttpPost]
public ActionResult Api()
{
return Json(new { name = "test" });
}
Run Code Online (Sandbox Code Playgroud)
它非常适合从asp.net mvc web服务器获取数据但是如何将数据从android发送到带有json格式或其他格式的asp.net mvc控制器?
我无法通过内存提供程序验证和测试我的数据库.例如,我将这些属性设置为必需:
public abstract class Log
{
#region Properties
public Guid Id { get; set; }
[Required]
public string ClientIp { get; set; }
[Required]
public string Application { get; set; }
[Required]
public string Host { get; set; }
[Required]
public string Path { get; set; }
[Required]
public string Method { get; set; }
[Required]
public string User { get; set; }
[Required]
public string Date { get; set; }
#endregion
}
Run Code Online (Sandbox Code Playgroud)
这是我的DBContext:
public class ApplicationDbContext : IdentityDbContext<ApplicationUsers, Role, …
Run Code Online (Sandbox Code Playgroud) unit-testing mstest in-memory-database data-annotations entity-framework-core
android ×1
asp.net-mvc ×1
css ×1
google-maps ×1
html ×1
javascript ×1
jquery ×1
mstest ×1
unit-testing ×1