xml布局如下:
xml version="1.0" encoding="utf-8"?>
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_wrap_content"
android:layout_wrap_content"
android:orientation="vertical"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:background="@mipmap/match_rule_dialog_bg"
>
android:layout_wrap_content"
android:paddingTop="@dimen/ui_25_dip"
android:paddingRight="@dimen/ui_10_dip"
android:paddingLeft="@dimen/ui_10_dip"
android:background="@drawable/corners_10_dp_shape"
android:orientation="vertical">
android:layout_wrap_content"
android:gravity="center"
android:textColor="@color/black01"
android:textSize="@dimen/ui_18_sp"
android:text="开聊活动规则"
android:textcolor:#6a8759;">"bold"/>
android:layout_wrap_content"
android:gravity="center"
android:textColor="@color/text_color_video"
android:textSize="@dimen/ui_15_sp"
android:text="活动时间:"
android:layout_marginTop="@dimen/small_space"
/>
android:layout_wrap_content"
android:textColor="@color/black01"
android:textSize="@dimen/ui_15_sp"
android:text="每天10:00-23:00整点开聊持续10分钟,"
/>
android:layout_wrap_content"
android:textColor="@color/black01"
android:textSize="@dimen/ui_15_sp"
android:text="例如10:00-10:10,23:00-23:10。"
/>
android:layout_wrap_content"
android:gravity="center"
android:textColor="@color/text_color_video"
android:textSize="@dimen/ui_15_sp"
android:text="活动规则:"
android:layout_marginTop="@dimen/small_space"
/>
android:layout_wrap_content"
android:textColor="@color/black01"
android:textSize="@dimen/ui_15_sp"
android:text="随机红包奖励。"
/>
android:layout_wrap_content"
android:gravity="center"
android:textColor="@color/text_color_video"
android:textSize="@dimen/ui_15_sp"
android:text="奖励对象:"
android:layout_marginTop="@dimen/small_space"
/>
android:layout_wrap_content"
android:textColor="@color/black01"
android:textSize="@dimen/ui_15_sp"
android:text="20-30岁认证用户"
/>
android:layout_wrap_content"
android:gravity="center"
android:textColor="@color/text_color_video"
android:textSize="@dimen/ui_15_sp"
android:text="活动细则:"
android:layout_marginTop="@dimen/small_space"
/>
android:layout_wrap_content"
android:textColor="@color/black01"
android:textSize="@dimen/ui_15_sp"
android:paddingBottom="@dimen/activity_horizontal_margin"
android:text="服。"/>
android:layout_25dp"
android:layout_@dimen/personal_praise"
android:src="@mipmap/video_detial_back"
android:layout_gravity="center_horizontal"
android:paddingTop="@dimen/ui_25_dip"
android:background="@color/transparent"/>
代码如下:
@Override
protected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);
setContentView(R.layout.activity_chat_rule);
ImageView delete=(ImageView)findViewById(R.id.match_rule_delete);
delete.setOnClickListener(new View.OnClickListener() {@Override
public void onClick(View view) {finish();
}});
}
效果如如下: