please use this
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/rlimg"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
app:cardUseCompatPadding="true"
app:cardPreventCornerOverlap="false"
android:innerRadius="0dp"
android:radius="0dp"
android:shape="ring"
android:thicknessRatio="1.9">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/imgperformarbg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
android:src="@drawable/h" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:scaleType="fitXY"
android:src="@drawable/h"/>
</RelativeLayout
>
</android.support.v7.widget.CardView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/card_view"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name"
android:textColor="#E6000000"
android:lineSpacingMultiplier=".9"
android:minLines="1"
android:maxLines="2"
android:id="@+id/txtperformarname"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Detail"
android:textColor="#CC000000"
android:layout_below="@+id/txtperformarname"
android:visibility="visible"
android:id="@+id/txtdetails"
/>
</LinearLayout>
</RelativeLayout>
Ваш код может дать сбой, если нет ввода.
Используйте стандартную функцию strstr()
. Зачем изобретать велосипед? Вы также можете улучшить сложность кода. Смотрите эту ссылку:
У меня пока нет разрешения комментировать, поэтому я должен ответить вам здесь.
Переменная char
кодируется 8 битами, поэтому она может иметь 256 значений [0,255]. Печатные символы можно найти в таблице ASCII , где вы можете видеть, что символ a
равен десятичному значению 97
.
Если вы рассматриваете символы как десятичное значение, я уверен, что вы сами сможете выяснить, как перейти от a (97)
к A (65)
, чтобы вы могли выполнить ту же операцию для любого символа.