上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 40 下一页
摘要: Fun with layers这篇文章的有些内容很奇怪,我根本就没有这种现象,所以暂时就这样吧In this post, I’ll explain how to add a border, rounded corners, and drop shadow to any UIView using so... 阅读全文
posted @ 2014-10-29 13:57 wuhn 阅读(195) 评论(0) 推荐(0) 编辑
摘要: I have a UIView and I'm trying to set its layer properties.self.colorSwatch = [[UIView alloc] initWithFrame:CGRectMake(400, 150, 100, 100)];self.color... 阅读全文
posted @ 2014-10-29 11:29 wuhn 阅读(1011) 评论(0) 推荐(0) 编辑
摘要: So right now I have a UIView with a UILabel in it. I want the background to have an opacity < 1.0 and the label to have an opacity of 1.0. However sin... 阅读全文
posted @ 2014-10-29 11:27 wuhn 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 在所有编程语言中都涉及到大量的字符串操作,可见熟悉对字符串的操作是何等重要。 Go中的字符串和C#中的一样(java也是),字符串内容在初始化后不可修改。 需要注意的是在Go中字符串是有UTF-8编码的,请注意保存文件时将文件编码格式改成UTF-8(特别是在windows下)。初始化var str ... 阅读全文
posted @ 2014-10-29 00:18 wuhn 阅读(2402) 评论(0) 推荐(0) 编辑
摘要: Channels can bebuffered. Provide the buffer length as the second argument tomaketo initialize a buffered channel:ch := make(chan int, 100)Sends to a b... 阅读全文
posted @ 2014-10-28 23:44 wuhn 阅读(189) 评论(0) 推荐(0) 编辑
摘要: Channels are a typed conduit through which you can send and receive values with the channel operator,<-.ch <- v // Send v to channel ch.v := <-ch ... 阅读全文
posted @ 2014-10-28 23:40 wuhn 阅读(135) 评论(0) 推荐(0) 编辑
摘要: The next section covers Go's concurrency primitives.A Tour of GoGoroutinesAgoroutineis a lightweight thread managed by the Go runtime.go f(x, y, z)sta... 阅读全文
posted @ 2014-10-28 23:32 wuhn 阅读(164) 评论(0) 推荐(0) 编辑
摘要: /* Exercise: Loops and Functions #43 */package main import ( "fmt" "math") func Sqrt(x float64) float64 { z := float64(2.) s := float64(0)... 阅读全文
posted @ 2014-10-28 23:29 wuhn 阅读(782) 评论(0) 推荐(0) 编辑
摘要: package mainimport ( "io" "os" "strings" "fmt")type rot13Reader struct { r io.Reader}func (rot13 rot13Reader)Read(p []byte) (n int, err... 阅读全文
posted @ 2014-10-28 23:27 wuhn 阅读(484) 评论(0) 推荐(0) 编辑
摘要: Remember the picture generator you wrote earlier? Let's write another one, but this time it will return an implementation ofimage.Imageinstead of a sl... 阅读全文
posted @ 2014-10-28 23:09 wuhn 阅读(400) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 40 下一页