我以前从未使用过这个库,现在我正在尝试使用它并添加所需的依赖项,但项目没有被同步。这是我的构建 gradle :
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
// implement support libraries
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:animated-vector-drawable:27.0.2'
implementation 'com.android.support:design:27.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:27.0.2'
// implement firebase libraries
implementation 'com.google.firebase:firebase-auth:11.0.4'
implementation 'com.google.firebase:firebase-database:11.0.4'
implementation 'com.google.firebase:firebase-storage:11.0.4'
implementation 'com.google.firebase:firebase-core:11.0.4'
// implement firebase-ui
implementation 'com.firebaseui:firebase-ui-database:2.3.0'
// implement lifecycle
implementation 'android.arch.lifecycle:extensions:1.1.0'
// implement circle image view
implementation 'de.hdodenhof:circleimageview:2.2.0'
// implement image cropper
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
// implement image compressor
implementation 'id.zelory:compressor:2.1.0'
// implement test
testImplementation 'junit:junit:4.12'
// implementation 'io.reactivex.rxjava2:rxjava:2.1.5'
implementation 'io.reactivex.rxjava2:rxjava:2.2.0'
// androidTestImplementation 'com.android.support.test:runner:1.0.2'
// androidTestImplementation …Run Code Online (Sandbox Code Playgroud) 我有recyclerview,为此,我使用了一个特定的视图。在那个视图中,我有 3textviews和一个图像按钮。先给textview我看数字。其他一些虚拟文本。当我的数字超过 10(2 个字符)时,除数字外的所有内容都向右移动。我该如何处理?
这是我的xml文件:
<RelativeLayout
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="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="70dp">
<LinearLayout
android:id="@+id/linlay"
android:layout_width="match_parent"
android:layout_height="70dp"
android:orientation="horizontal"
android:gravity="center_vertical">
<TextView
android:id="@+id/buses_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:textSize="25dp"
android:textColor="@color/gradStop"
android:layout_marginLeft="15dp"/>
<LinearLayout
android:layout_width="300dp"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/buses_route_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="30dp"
android:text="Bus Route"
android:textColor="@color/gradStart"
android:textSize="20dp"/>
<TextView
android:id="@+id/buses_cycle_duration"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="30dp"
android:text="Duration"
android:textColor="@color/gradStop"
android:textSize="20dp"/>
</LinearLayout>
<ImageButton
android:id="@+id/buses_favourites"
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/ic_favorite_border_black_24dp"
android:background="@color/transparent"
android:layout_alignParentRight="true"/>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
这是屏幕截图: