TabView(selection: $currentIndex) {
ForEach(1..<numberOfImages) { num in
Image("er\(num)")
.resizable()
.aspectRatio(contentMode: .fill)
.frame(height: 200)
.cornerRadius(15)
.overlay(Color.black.opacity(0.4)).cornerRadius(15)
.padding([.leading, .trailing], 10)
.tag(num)
}
}
.frame(height: 200)
.tabViewStyle(PageTabViewStyle())
.padding()
HStack {
Image(champions.imagei1)
.resizable()
.scaledToFit()
.aspectRatio(1, contentMode: .fit)
.frame(width: 60, height: 60)
Spacer()
Image(champions.imagei2)
.resizable()
.scaledToFit()
.aspectRatio(1, contentMode: .fit)
.frame(width: 60, height: 60)
Spacer()
Image(champions.imagei3)
.resizable()
.scaledToFit()
.aspectRatio(1, contentMode: .fit)
.frame(width: 60, height: 60)
}.padding()
catch (InterruptedException | IOException exception)
Intent intent = new Intent(this, SomeOtherActivity.class);
intent.putExtra("NETWORK_ERROR", "Проблема с подключением"); //это опционально
startActivity(intent);
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.Toolbar.Title"
/>
<TextView
android:id="@+id/additional_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.Toolbar.SubTitle"
/>
</LinearLayout>
protected Toolbar mToolbar;
protected TextView mToolbarTitle;
protected TextView mToolbarSubTitle;
...
View statusContainer = LayoutInflater.from(this).inflate(R.layout.actionbar_status, mToolbar, false);
ActionBar.LayoutParams lp = new ActionBar.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
mToolbar.addView(statusContainer, lp);
mToolbarTitle = (TextView) statusContainer.findViewById(R.id.title);
mToolbarSubTitle = (TextView) statusContainer.findViewById(R.id.subTitle);
mToolbarTitle.setText("Какой-то заголовок");
mToolbarSubTitle.setText("Какой-то дополнительный текст");