小编gda*_*imi的帖子

设置vaadin表高度以适合内容

我在项目中使用CustomLayout来分隔UI对象和它们的样式.

我有桌子的问题.

我定义了一个div,我希望将表的高度设置为div的高度.

哪种方式最好?

我想:

table.setsizeFull() ;
table.setPageLength(0);
Run Code Online (Sandbox Code Playgroud)

在代码中,但结果不是我想要的.我希望桌子在div的尺寸中全尺寸,内部有或没有元素.

有什么建议?

css vaadin

5
推荐指数
1
解决办法
1万
查看次数

如何使imageview的选择器仅更改背景而不更改图像源?

我有一个带有图像src和背景颜色的ImageView.

此图像是布局,即gridview项布局.

我想创建一个xml选择器,当选择项目时,图像背景会改变,但图像src不会改变.

类似于android的主菜单与图标与文本,我想只突出图像.

我不会为对象的每个状态制作图像,我只想更改背景.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <ImageView
        android:id="@+id/img_0"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="30dp"
        android:background="@drawable/selector_categorie"
        android:src="@drawable/ic_launcher"/>

    <TextView
        android:id="@+id/text_1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/img_0"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="15dp"
        android:gravity="center"
        android:textAppearance="?android:attr/textAppearanceLarge" />

    <TextView
        android:id="@+id/text_2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/text_1"
        android:layout_marginTop="15dp"
        android:gravity="center"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <TextView
        android:id="@+id/text_3"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/text_2"
        android:layout_marginTop="15dp"
        android:gravity="center"
        android:textAppearance="?android:attr/textAppearanceMedium" />


</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

xml android imageview

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

android ×1

css ×1

imageview ×1

vaadin ×1

xml ×1