Попробуйте использовать pyenv :
Шаг 1: установите virtualenv
с помощью pip
pip install virtualenv
Шаг 2 В папке откройте cmd
и запустить:
python -m venv virtualenvname
например: python -m venv india
Шаг 3. Активируйте свою виртуальную среду:
india\Scripts\activate
Примечание: S
of sripts
должен быть в шапках
Теперь вы должны увидеть india
перед расположением в вашем cmd. Если да, то ваш виртуальный env был активирован.
Что-то вроде этого:
(india) D:\dev\python\django\
я создал первый подход с использованием framelayout следующим образом:
<FrameLayout
android:id="@+id/frame"
android:layout_width="match_parent"
android:layout_height="70dp"
android:onClick="rotate">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
app:layout_constraintBottom_toTopOf="@+id/view"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView2">
<Button
android:id="@+id/button"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/colorPrimary" />
<Button
android:id="@+id/button2"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/colorAccent" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:text="Button text"
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
android:textColor="@android:color/white" />
</FrameLayout>
для вращения любого представления создайте файл anim.xml в папке anim
в res
right click
на res
-> new android res dir
-> выберите anim
, затем создайте анимированный файл, щелкните правой кнопкой мыши на папке anim
, которую вы только что создали, и new anim res file
, а затем вставьте код в боковую часть, это повернет ваш фрейм-макет в этом определенном коде на 180 градусов [1112 ]
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true">
<rotate
android:duration="500"
android:fromDegrees="0"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="180" />
</set>
используйте его как следовать на kotlin
fun rotate(view: View) {
val rotate = AnimationUtils.loadAnimation(
applicationContext,
R.anim.rotate
)
frame.startAnimation(rotate)
}