Java CardView文本查看边框右侧

Java CardView文本查看边框右侧,java,android,android-layout,Java,Android,Android Layout,我正在学习安卓。我试图在我的文本视图中设置marginRight,但它会剪切我的文本并在布局中显示空白。我的XML如下所示 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical" android:layout_width="match

我正在学习安卓。我试图在我的文本视图中设置marginRight,但它会剪切我的文本并在布局中显示空白。我的XML如下所示

<LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical" 
android:layout_width="match_parent"
android:layout_height="match_parent">



<android.support.v7.widget.CardView
    android:id="@+id/quoteCard"
    android:layout_marginTop="4dp"
    android:layout_marginLeft="@dimen/activity_horizontal_margin"
    android:layout_marginBottom="@dimen/activity_horizontal_margin"
    android:layout_marginRight="@dimen/activity_horizontal_margin"
    android:layout_width="match_parent"
    android:elevation="3dp"
    app:cardCornerRadius="6dp"
    android:layout_height="match_parent">

    <ImageView
        android:id="@+id/cardBackground"
        android:scaleType="fitXY"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <LinearLayout
        android:padding="8dp"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">


        <de.hdodenhof.circleimageview.CircleImageView
            android:layout_marginTop="20dp"
            android:layout_gravity="center_horizontal"
            android:id="@+id/authorImage"
            android:layout_width="128dp"
            android:layout_height="128dp"
            app:civ_border_width="2dp"
            app:civ_border_color="#99333333"/>


        <TextView
            android:layout_weight="1"
            android:gravity="center"
            android:layout_marginTop="6dp"
            android:layout_marginRight="20dp"
            android:layout_marginLeft="20dp"
            android:layout_marginBottom="6dp"
            android:lineSpacingExtra="15dp"
            android:id="@+id/textDetailQuote"
            android:text="The price of success is hard work, dedication to the job at hand, and the determination that whether we win or lose, we have applied the best of ourselves to the task at hand.Read more at: "
            android:textSize="18sp"
            android:textStyle="bold"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />


        <TextView
            android:layout_marginBottom="10dp"
            android:layout_marginRight="8dp"
            android:id="@+id/textAuthorSign"
            android:layout_gravity="right"
            android:text="- ABJ Abdul Kalam"
            android:textStyle="bold"
            android:textSize="16sp"
            android:visibility="invisible"
            android:typeface="serif"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />



    </LinearLayout>

</android.support.v7.widget.CardView>

请检查并让我知道我在这方面有什么错


感谢您在文本视图中使用paddingLeft和paddingRight代替maringLeft和marginRight

  <TextView
        android:gravity="center"
        android:layout_marginTop="6dp"
        android:paddingRight="16dp"
        android:paddingLeft="16dp"
        android:layout_marginBottom="6dp"
        android:lineSpacingExtra="15dp"
        android:id="@+id/textDetailQuote"
        android:text="The price of success is hard work, dedication to the job at hand, and the determination that whether we win or lose, we have applied the best of ourselves to the task at hand.Read more at: "
        android:textSize="18sp"
        android:textStyle="bold"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />


尝试在文本视图中将android:layout\u width=“match\u parent”
更改为
wrap\u content
。@Vucko感谢您的建议,但它仍然显示相同的内容:(我发现这有助于理解填充和边距的概念,我认为您混淆了它们:填充也不起作用:(添加此选项可以解决android:singleLine=“true”
android:includeFontPadding=“false”
仍然存在的问题:(