【发布时间】:2020-01-14 08:03:20
【问题描述】:
我希望图像填满所有框,我不想在它们之间有那些边框。图像没有填满所有的方框。我尝试了所有方法,但没有任何效果。如果有人可以帮助我,我将不胜感激,问题是当我将它旋转 90 度时。
照片1 this is how it is 照片2 this is how i want
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/tile2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"/>
<ImageView
android:id="@+id/tile_player_2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
<ImageView
android:id="@+id/tile_enemy_2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
</RelativeLayout>
</LinearLayout>
这里是java
tiles[2].setImageResource(getResources().getIdentifier("tile_lava", "drawable", getPackageName()));
tiles[0].setRotation(90);
当我旋转它时,我会在它们之间收到空格
【问题讨论】: