今天发现设置viewpager高度为wrap_content时并没作用.stackoverflow给出了解决方式,就是自己定义viewpager,重写onMesure()方法: public class WrapContentHeightViewPager extends ViewPager { /** * Constructor * * @param context the context */ public WrapContentHeightViewPager(Context context
在开发中如果你的xml文件的跟布局是ScrollView,在ScrollView中无论你写什么样的布局,其默认情况下都是不能填充整个布局的.也就是说你的ScrollView中的子布局设置fill_parent不起作用. 解决办法: 在ScrolllView控件中加上android:fillViewport="true"则问题解决. 官方文档的解释: Indicates this ScrollView whether it should stretch its content heigh
dongyangzhang android gridview画分割线,如图: 1.先上图: 2.具体实现代码: public class LineGridView extends GridView { public LineGridView(Context context) { super(context); // TODO Auto-generated constructor stub } public LineGridView(Context context, AttributeSet at