提出需求 GridView控件在开发后台管理的时候非常方便快速,但是要实现没有数据时显示“没有数据”,并居中,是一件比较麻烦的事情,这里在一个公开的方法里实现了绑定List<T>和DataTable时,如果没有记录显示“没有数据”和表头. 显示效果 实现代码 using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Reflection; using Sy…
Leetcode 69. Sqrt(x) Easy https://leetcode.com/problems/sqrtx/ Implement int sqrt(int x). Compute and return the square root of x, where x is guaranteed to be a non-negative integer. Since the return type is an integer, the decimal digits are truncat…
我们通常在ListView或者GridView响应点击Item事件,但很多时候我们同样也 希望监听到点击空白区域的事件来做更多的处理.本文以GridView为例给出一个实现 的方法,扩展GridView并可作为通用控件使用.ListView的实现应该也大同小异 好吧,原来之前写过另外一篇,不过监控的是ACTION_UP事件,但这篇更加通用 代码比较简单,先贴代码再做下解释 public class MyGridView extends GridView { public interface On…