Ich habe 4 Bildansichten miteinander verbunden mit "ToLeftOf" -Befehl. Das Problem ist, wenn ich eine von ihnen unsichtbar mache, die andere an der gleichen Position bleibend oder zur linken Seite des Plans gehend.Moving ImageView nach rechts von Layout
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MapsActivity" >
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.ahmetbesli.eczanem.MapsActivity" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/relative"
android:layout_gravity="bottom"
android:layout_marginBottom="85dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/direction"
android:src="@drawable/ic_directions_black_24dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:visibility="visible"
android:background="@drawable/rounded_corner"
android:animateLayoutChanges="true"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/bullet"
android:src="@drawable/ic_format_align_left_black_24dp"
android:layout_toLeftOf="@+id/direction"
android:layout_toStartOf="@+id/direction"
android:visibility="visible"
android:background="@drawable/rounded_corner"
android:layout_marginRight="1dp"
android:layout_marginEnd="1dp"
android:animateLayoutChanges="true"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/share"
android:src="@drawable/ic_share_black_24dp"
android:layout_toLeftOf="@+id/bullet"
android:layout_toStartOf="@+id/bullet"
android:visibility="visible"
android:background="@drawable/rounded_corner"
android:layout_marginRight="1dp"
android:layout_marginEnd="1dp"
android:animateLayoutChanges="true"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/access"
android:src="@drawable/ic_accessibility_black_24dp"
android:layout_toLeftOf="@+id/share"
android:layout_toStartOf="@+id/share"
android:visibility="visible"
android:background="@drawable/rounded_corner"
android:layout_marginRight="1dp"
android:layout_marginEnd="1dp"
android:animateLayoutChanges="true"/>
</RelativeLayout>
</FrameLayout>
Ich verwendete animateLayoutChanges = "True", aber es hat nicht funktioniert. Und so machen sie sie unsichtbar oder sichtbar.
if (!marker.getTitle().equals("Buradasın")) {
latLngMaps = marker.getPosition();
share.setVisibility(View.VISIBLE);
direction.setVisibility(View.VISIBLE);
bullet.setVisibility(View.VISIBLE);
access.setVisibility(View.VISIBLE);
} else {
bullet.setVisibility(View.VISIBLE);
share.setVisibility(View.INVISIBLE);
direction.setVisibility(View.INVISIBLE);
access.setVisibility(View.INVISIBLE);
}
Was tun möchte, ist können sagen, sie wie X Y Z Q bleiben wenn ich Y unsichtbar machen es wie X Z F sein muss Es wird nur der Platz des unsichtbaren gehen. Danke fürs Helfen.
Es hat funktioniert. Wie kann ich alle Bilder nach rechts verschieben? Sie stehen jetzt auf der linken Seite. –
Ich weiß nicht, was Ihre App tut, und wenn es zutrifft, sollte 'android: layoutDirection =" rtl "' auf Ihren 'LinearLayout'-Attributen dies tun (dieses Flag wird angewendet, egal ob die Sprache des Benutzers richtig ist nach links oder von links nach rechts) – mVck