小编k1k*_*ans的帖子

在Monotouch中调整自定义UITableViewCell的大小

我想做的就是增加单个细胞的高度.我在IB和我的代码中增加了高度,但两者似乎都没有工作.Poicell是我的自定义uitableviewcell的类.以下是我的代码:

public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
{
            var cell = tableView.DequeueReusableCell(kCellIdentifier) as PoiCell;   

            if (null == cell) {

                cell = new PoiCell();

                var views = NSBundle.MainBundle.LoadNib("PoiCell", cell, null);

                cell = Runtime.GetNSObject(views.ValueAt(0)) as PoiCell;
            }
            UIImage imgAmenity = UIImage.FromBundle ("Images/ico-ConservationGarden");
            UIImage imgRestrooms = UIImage.FromBundle ("Images/ico-restrooms");

            RectangleF rectCell = cell.Frame;
            rectCell.Height = 50;

            cell.Frame = rectCell;
            var imageView = new UIImageView(imgAmenity)
            {
                Frame = new Rectangle(10, 24, 20, 20)   
            };
            var imageView2 = new UIImageView(imgRestrooms)
            {
                Frame = new RectangleF(30, …
Run Code Online (Sandbox Code Playgroud)

c# iphone xamarin.ios

4
推荐指数
1
解决办法
2135
查看次数

使用Newtonsoft Json.NET解析多维JSON数组

我让Json返回如下:

[{"CreatedBy":"GIS_DB","CreatedDate":"3/8/2012 10:44:00 AM","Id":39,"ModifiedBy":"","ModifiedDate":"","名称":"CF-39","StatusId":1,"TrailCoordinates":[{"CreatedBy":"GIS_DB","CreatedDate":"3/8/2012 10:44:00 AM","Id": 1637年, "纬度":32.76004207, "经度": - 97.34006853, "ModifiedBy": "", "ModifiedDate": "", "SortOrder的":1, "TrailId":39},{ "CreatedBy": "GIS_DB" ,"CreatedDate":"3/8/2012 10:44:00 AM","Id":1638,"Latitude":32.76004333,"经度": - 97.34012121,"ModifiedBy":"","ModifiedDate":" ","SortOrder":2,"TrailId":39}]},{"CreatedBy":"GIS_DB","CreatedDate":"3/8/2012 10:44:00 AM","Id":40, "ModifiedBy": "", "ModifiedDate": "", "名称": "CF-40", "StatusId":1, "TrailCoordinates":[{ "CreatedBy": "GIS_DB", "CreatedDate":"3/8/2012 10:44:00 AM","Id":3755,"纬度":32.76034332,"经度": - 97.3402069,"ModifiedBy":"","ModifiedDate":"","SortOrder":1 ,"TrailId":40},{"CreatedBy":"GIS_DB","CreatedDate":"3/8/2012 10:44:00 AM","Id":3756,"纬度":32.76019181,"经度" :-97.3402448, "ModifiedBy": "", "ModifiedDate": "", "SortOrder的":2 "TrailId":40}]}]

这些是我的班级......

public class Trails
{
    [MonoTouch.Foundation.Preserve]
    public Trails(){ TrailCoord = new List<trailcoords>();}

    [MonoTouch.Foundation.Preserve, JsonProperty("Name")]
    public string TrailName { get; set; }

    [MonoTouch.Foundation.Preserve, JsonProperty("StatusId")]
    public int StatusId { get; …
Run Code Online (Sandbox Code Playgroud)

c# iphone json.net xamarin.ios

3
推荐指数
1
解决办法
1万
查看次数

从URL获取MD5哈希文件

我得到的结果是相同类型的文件返回相同的md5哈希值.例如,两个不同的jpgs给了我相同的结果.但是,jpg vs apk正在给出不同的结果.

这是我的代码......

public static String checkHashURL(String input) {
    try {
        MessageDigest md = MessageDigest.getInstance("MD5");
        InputStream is = new URL(input).openStream();

        try {
            is = new DigestInputStream(is, md);

            int b;

            while ((b = is.read()) > 0) {
                ;
            }
        } finally {
            is.close();
        }
        byte[] digest = md.digest();
        StringBuffer sb = new StringBuffer();

        for (int i = 0; i < digest.length; i++) {
            sb.append(
                    Integer.toString((digest[i] & 0xff) + 0x100, 16).substring(
                            1));
        }
        return sb.toString();

    } catch (Exception ex) {
        throw …
Run Code Online (Sandbox Code Playgroud)

java android md5

3
推荐指数
1
解决办法
3310
查看次数

标签 统计

c# ×2

iphone ×2

xamarin.ios ×2

android ×1

java ×1

json.net ×1

md5 ×1