两篇优秀文章,看就完事了:
https://blog.csdn.net/zhangliang_571/article/details/23508953
https://blog.csdn.net/u010256388/article/details/68491509