Created
March 12, 2024 09:44
-
-
Save svenbioinf/1fc1e81f5f3325e266b139b7e7f9d603 to your computer and use it in GitHub Desktop.
Fixed image position and stop re-scaling. Kotlin, Android Studio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#xml file | |
<?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/backgroundImageView" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:src="@drawable/background" | |
android:scaleType="centerCrop" /> | |
<ImageView | |
android:id="@+id/circleImageView" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_alignParentStart="true" | |
android:layout_alignParentTop="true" | |
android:layout_marginStart="25dp" | |
android:layout_marginLeft="100dp" | |
android:layout_marginTop="188dp" | |
android:src="@drawable/circle" /> | |
</RelativeLayout> | |
#kt file | |
package com.example.body5 | |
import androidx.appcompat.app.AppCompatActivity | |
import android.os.Bundle | |
class MainActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment