0 / 0 / 0
Регистрация: 05.05.2016
Сообщений: 3
1

Прокручивание экрана с кнопками

29.05.2016, 19:54. Показов 851. Ответов 4
Метки нет (Все метки)

Author24 — интернет-сервис помощи студентам
Как написать ScroolView(прокручивание экрана) с кнопками(без кнопок умею) чтобы работало в Activity?
и как сделать чтобы прокручивание работало с картинками

XML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:background="@drawable/fon"
    tools:context="com.example.abc.kulturaevenkov.MainActivity">
    
    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Введение"
        android:id="@+id/button"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="54dp" />
 
    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Фольклор"
        android:id="@+id/button2"
        android:layout_below="@+id/button"
        android:layout_centerHorizontal="true" />
 
    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Одежда"
        android:id="@+id/button3"
        android:layout_below="@+id/button2"
        android:layout_centerHorizontal="true" />
 
    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Обереги и талисманы"
        android:id="@+id/button4"
        android:layout_below="@+id/button3"
        android:layout_centerHorizontal="true" />
 
    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Музыка"
        android:id="@+id/button5"
        android:layout_below="@+id/button4"
        android:layout_centerHorizontal="true" />
 
    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Шаманы"
        android:id="@+id/button6"
        android:layout_below="@+id/button5"
        android:layout_centerHorizontal="true" />
 
    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Язык"
        android:id="@+id/button7"
        android:layout_below="@+id/button6"
        android:layout_centerHorizontal="true" />
 
    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="О программе"
        android:id="@+id/button8"
        android:layout_below="@+id/button7"
        android:layout_centerHorizontal="true" />
</RelativeLayout>
0
Programming
Эксперт
94731 / 64177 / 26122
Регистрация: 12.04.2006
Сообщений: 116,782
29.05.2016, 19:54
Ответы с готовыми решениями:

Прокручивание ImageView
Здравствуйте, появилась проблема не могу решить. Есть такой код &lt;?xml version=&quot;1.0&quot;...

Синхронное прокручивание scrollView
Есть ли возможность создания двух scrollView, чтобы при прокручивании первого, прокручивался...

Отследить прокручивание ListView до конца
Здравствуйте Возник вопрос: как можно программно отследить момент, что ListView прокручен до...

Прокручивание RichTextBox кнопками
Здравствуйте. У меня есть richtextbox с длинным текстом. Мне необходимо сделать прокручивание...

4
1 / 1 / 0
Регистрация: 21.02.2016
Сообщений: 32
29.05.2016, 21:52 2
В ScroolView помести любой Layout в который потом пихай что угодно: кнопки, картинки...

Добавлено через 11 минут
XML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="@drawable/fon"
tools:context="com.example.abc.kulturaevenkov.MainActivity">
 
<ScrollView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/scrollView">
    <LinearLayout
    android:orientation="vertical"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/menuLayout">
        <Button 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:text="Введение"
            android:id="@+id/button"
            android:layout_alignParentTop="true"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="54dp" />
 
        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Фольклор"
            android:id="@+id/button2"
            android:layout_below="@+id/button"
            android:layout_centerHorizontal="true" />
 
        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Одежда"
            android:id="@+id/button3"
            android:layout_below="@+id/button2"
            android:layout_centerHorizontal="true" />
 
        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Обереги и талисманы"
            android:id="@+id/button4"
            android:layout_below="@+id/button3"
            android:layout_centerHorizontal="true" />
 
        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Музыка"
            android:id="@+id/button5"
            android:layout_below="@+id/button4"
            android:layout_centerHorizontal="true" />
 
        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Шаманы"
            android:id="@+id/button6"
            android:layout_below="@+id/button5"
            android:layout_centerHorizontal="true" />
 
        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Язык"
            android:id="@+id/button7"
            android:layout_below="@+id/button6"
            android:layout_centerHorizontal="true" />
 
        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="О программе"
            android:id="@+id/button8"
            android:layout_below="@+id/button7"
            android:layout_centerHorizontal="true" />
    </LinearLayout>
</ScrollView>
</RelativeLayout>
0
0 / 0 / 0
Регистрация: 05.05.2016
Сообщений: 3
30.05.2016, 16:12  [ТС] 3
спс
но не работает
0
2883 / 2295 / 769
Регистрация: 12.05.2014
Сообщений: 7,978
30.05.2016, 16:18 4
если ты хочешь что бы тебе помогли тут, на форуме, от попытайся внятно сформулировать что надо сделать
и на будущее тоже - отвечать вот так вот
Цитата Сообщение от nokd Посмотреть сообщение
спс
но не работает
не есть гуд

Добавлено через 1 минуту
я лично присутствовал при случае когда наша бухгалтерха орала нам (it-шникам) по телефону -
ВАША ПРОГРАММА НЕ РАБОТАЕТ!!!!!1111
оказалось что у нее вообще комп выключен - выпал шнур из системного блока

аналогия с твоим ответом яснА?
0
145 / 134 / 22
Регистрация: 28.06.2015
Сообщений: 654
31.05.2016, 09:08 5
Цитата Сообщение от nokd Посмотреть сообщение
спс
но не работает
Всё работает. Приводите ошибки, или скриншоты экрана, что у вас там не работает.
0
31.05.2016, 09:08
IT_Exp
Эксперт
87844 / 49110 / 22898
Регистрация: 17.06.2006
Сообщений: 92,604
31.05.2016, 09:08
Помогаю со студенческими работами здесь

Прокручивание страницы на высоту экрана
Доброго времени суток всем. Задался вопросом, а как прокрутить страницу на 100% одним движением...

GridBagLayout и GridLayout - промежутки между кнопками, и между кнопками и окном программы
Новичок, ногами не бейте. Иду по учебнику - сделал калькулятор с помощью GridLayout. Работает вроде...

Прокручивание фона
Хочу, чтоб фон зафиксировался и не скролился. Фон ставил в настройках CMS, а вот как зафиксировать,...

Прокручивание вниз
Доброго времени суток! У меня проблема с построением пути до div-а. Есть страничка &lt;?php &lt;body...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
5
Ответ Создать тему
Опции темы

КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2024, CyberForum.ru