在我将支持库从v4升级到v7之后,按钮的syle就改变了。
即使使用ImageButton和set View.setVisibility(View.Gone),它仍然通过高亮显示它的位置,就像下面的图片一样。
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:background="#F44336" >
<TextView
android:id="@+id/txtTitle"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="2"
android:background="#E53935"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff" />
<ImageButton
android:id="@+id/btnSearch"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:src="@drawable/find" />
</LinearLayout>
发布于 2017-05-18 02:16:16
您正在看到“位置高亮”,因为背景和文本视图的颜色是不同的。背景以以下颜色显示:
android:background="#F44336"
线性布局是:
android:background="#E53935"
这些颜色都是红色和非常相似,但又不同。从TextView删除背景和“位置高亮”将被删除,因为只有布局背景颜色将保留。
https://stackoverflow.com/questions/44029557
复制相似问题