Giter VIP home page Giter VIP logo

Comments (4)

mmin18 avatar mmin18 commented on August 16, 2024

能把具体的代码贴上来看一下吗

from flexlayout.

dxp2020 avatar dxp2020 commented on August 16, 2024

TextView
android:id="@+id/tv_high_speed_charge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/add_charge"
android:textColor="@color/color_999999"
android:visibility="gone"
app:layout_centerX="50%"
app:layout_top="prev.bottom+15dp"

就比如说这个控件,隐藏之后仍然占用了空间

from flexlayout.

dxp2020 avatar dxp2020 commented on August 16, 2024

你们没有这种情况么

from flexlayout.

mmin18 avatar mmin18 commented on August 16, 2024

我试了一下好像没问题
fl

<?xml version="1.0" encoding="utf-8"?>
<com.github.mmin18.widget.FlexLayout
	xmlns:android="http://schemas.android.com/apk/res/android"
	xmlns:app="http://schemas.android.com/apk/res-auto"
	android:layout_width="match_parent"
	android:layout_height="match_parent">

	<View
		android:layout_width="60dp"
		android:layout_height="60dp"
		android:background="#f00"
		app:layout_centerX="50%"
		app:layout_top="10dp"/>

	<TextView
		android:id="@+id/tv_high_speed_charge"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:text="tv_high_speed_charge"
		android:textColor="#fff"
		android:visibility="gone"
		app:layout_centerX="50%"
		app:layout_top="prev.bottom+15dp"/>

	<View
		android:layout_width="60dp"
		android:layout_height="60dp"
		android:background="#0f0"
		app:layout_centerX="50%"
		app:layout_top="tv_high_speed_charge.bottom"/>

	<Button
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:onClick="switchGone"
		android:text="switch"
		app:layout_centerX="50%"
		app:layout_centerY="50%"/>
</com.github.mmin18.widget.FlexLayout>
	public void switchGone(View v) {
		View g = findViewById(R.id.tv_high_speed_charge);
		g.setVisibility(g.getVisibility() == View.VISIBLE ? View.GONE : View.VISIBLE);
	}

from flexlayout.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.