我需要在我的android layout.xml中水平居中网格视图.我已经搜索了谷歌很长一段时间,但没有成功找到答案.
我只能通过更改strechMode来更改gridview水平位置,但我的项目不会彼此靠近.我需要的是一个靠近另一个(没有空格)并且水平居中的物品.我选择了strechmode = none,所以现在我的项目彼此靠近,但它们位于屏幕的左侧,我只想让它们水平居中.
这是我的布局xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background"
android:gravity="center">
<GridView android:id="@+id/lw_gridview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numColumns="3"
android:columnWidth="48dp"
android:horizontalSpacing="0dp"
android:verticalSpacing="0dp"
android:stretchMode="none"
/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
这是图像片段,由图像适配器在gridview上设置:
imageView = new ImageView(context);
imageView.setLayoutParams(new GridView.LayoutParams(48,48)); //on medium density
imageView.setScaleType(ImageView.ScaleType.CENTER);
imageView.setPadding(0, 0, 0, 0);
Run Code Online (Sandbox Code Playgroud)
我怎么能成功?
在视图结果树中访问我的应用程序时出现异常:响应消息:收到致命警报:unknown_ca 确保浏览器设置为接受JMeter代理证书
证书仅在firefox证书配置的服务器部分可见.它在权威部分不可见.
有线索吗?